[Rails-core] Graceful handling of missing STI constants

2015-01-25 Thread Maxim Chernyak
When using STI, if you introduce a new subclass in a git branch, then create a db record while in it, then switch to another branch, you will get uninitialized constant error when trying to query those records. Certain kinds of applications (like ours) could run into this a lot, so I'm wonderin

Re: [Rails-core] Graceful handling of missing STI constants

2015-01-25 Thread Andrew Kaspick
Why not just use different databases in your different git branches? On Sun, Jan 25, 2015 at 3:42 PM, Maxim Chernyak wrote: > When using STI, if you introduce a new subclass in a git branch, then > create a db record while in it, then switch to another branch, you will get > uninitialized consta

Re: [Rails-core] Graceful handling of missing STI constants

2015-01-25 Thread Maxim Chernyak
On Sunday, January 25, 2015 at 3:51:52 PM UTC-5, Andrew Kaspick wrote: > > Why not just use different databases in your different git branches? > To avoid losing accumulated sample data, and avoid maintaining setup scripts when they aren't a priority yet. > > On Sun, Jan 25, 2015 at 3:42 PM, M

Re: [Rails-core] Graceful handling of missing STI constants

2015-01-25 Thread Matt Jones
On Jan 25, 2015, at 3:42 PM, Maxim Chernyak wrote: > When using STI, if you introduce a new subclass in a git branch, then create > a db record while in it, then switch to another branch, you will get > uninitialized constant error when trying to query those records. Certain > kinds of applic

Re: [Rails-core] Graceful handling of missing STI constants

2015-01-25 Thread Maxim Chernyak
On Sunday, January 25, 2015 at 8:50:07 PM UTC-5, Matt jones wrote: > > > On Jan 25, 2015, at 3:42 PM, Maxim Chernyak > wrote: > > > When using STI, if you introduce a new subclass in a git branch, then > create a db record while in it, then switch to another branch, you will get > uninitialized