Hi, We have a project at my workplace which heavily relies on a custom in-house extension to ActiveRecord which does this (but ofcourse in an uglier way). It'd be great if this was a builtin feature.
Hardcoding class names in table rows makes for tedious migrations whenever classes are renamed. Good luck! :) On Thu, May 8, 2014 at 6:00 PM, Zac Moody <xanh...@gmail.com> wrote: > Hi all, > > I was thinking that someone might want the type column used with > Single-Table Inheritance to be an Enum rather than a string. Is the > counter argument that STI is responsible for the type column so it doesn't > matter? > > If the inheritance_column did support enum, would the resulting code be > repeating itself too much? > > class User < ActiveRecord::Base > enum type: [:student, :teacher] > end > > class Teacher < User > end > class Student < User > end > > If there's interest in this feature I would be happy to work on adding it. > > Zac > > -- > 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.