Has_many having another has_many

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.

2009/7/1 Raj S. [email protected]:

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

for lots of examples of such things.

Colin