Robb Kidd wrote in post #1050675: > class Fruit < ActiveRecord::Base > belongs_to :basket > end > > class Apple < Fruit > end > > class Basket < ActiveRecord::Base > has_many :fruits > end > > Ref: "Single Table Inheritance" > http://api.rubyonrails.org/classes/ActiveRecord/Base.html
Robb: Pardon -- Although my code shows it, I should have stated explicitly that I am sticking all the STI sub-classes in a Fruit module and app/model/fruit subdirectory. I envision enough Fruit sub-classes that I don't want them all in the toplevel app/model directory. -- Posted via http://www.ruby-forum.com/. -- 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@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.