Why not just use different databases in your different git branches?

On Sun, Jan 25, 2015 at 3:42 PM, Maxim Chernyak <madfanc...@gmail.com>
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 applications (like ours) could run into this a lot, so I'm
> wondering if there could be a null-object-patternish solution to this. E.g:
>
> * Accept proc for inheritance_column, which evaluates on instances, with
> type passed as an arg to it, and whatever it returns becoming the record in
> that case. This way we can plug those records with some placeholders
> * Add option self.ignore_unknown_types = true to activerecord to simply
> auto-rescue + skip records with uninitialized constant error (perhaps print
> a warning instead)
>
> Only to be used in dev/staging of course. Any thoughts?
>
> --
> You received this message because you are subscribed to the Google Groups
> "Ruby on Rails: Core" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to rubyonrails-core+unsubscr...@googlegroups.com.
> To post to this group, send email to rubyonrails-core@googlegroups.com.
> Visit this group at http://groups.google.com/group/rubyonrails-core.
> For more options, visit https://groups.google.com/d/optout.
>

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Core" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to rubyonrails-core+unsubscr...@googlegroups.com.
To post to this group, send email to rubyonrails-core@googlegroups.com.
Visit this group at http://groups.google.com/group/rubyonrails-core.
For more options, visit https://groups.google.com/d/optout.

Reply via email to