Content

File: November 2009

I personally don’t think this is all that exciting — but I see this question asked a lot and just want something to point at from now on.
Say you have several ‘nested’ has_many relations:

class State < ActiveRecord::Base
has_many :cities
end

class City < ActiveRecord::Base
has_many :streets
belongs_to :state
end

class Street < ActiveRecord::Base
has_many :houses
[...]

4 comments  ::  (Read the rest of this)