stephane.thibaudeau-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
2007-Jan-04 17:53 UTC
STI with numeric keys as types
Hi, I wish to use single table inheritance with a legacy database. The problem is that the "type" column holds numeric keys instead of strings (because or performance issues blah blah...) For example, in a table ''Components'' the value 1 in type means that I have a DialogComponent, 2 means ProcessComponent, ... I''d like to have models like this : class Component < ActiveRecord::Base; end; class DialogComponent < Component; end; class ProcessComponent < Component; end; but I can''t see how to achieve this. Thanks for your help, Stephane. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---