A person has_many cars. A car has_many lights. Can I write a person has_many lights? A snippet of code to help me understand will help. -- Posted via http://www.ruby-forum.com/.
2009/7/1 Raj Singh <rails-mailing-list-ARtvInVfO7ksV2N9l4h3zg@public.gmane.org>:> > A person has_many cars. > > A car has_many lights. > > Can I write a person has_many lights? > > A snippet of code to help me understand will help.Try person has_many :lights, :through => :cars See http://api.rubyonrails.org/classes/ActiveRecord/Associations/ClassMethods.html for lots of examples of such things. Colin> -- > Posted via http://www.ruby-forum.com/. > > > >