Searching on google yields quite a lot of results describing the
following problems:
class Person < ActiveRecord::Base
belongs_to :house
end
class House < ActiveRecord::Base
has_many :people
belongs_to :city
end
class City < ActiveRecord::Base
has_many :houses
has_many :people, :through => :houses
belongs_to :country
end
class Country < ActiveRecord::Base
has_many :cities
has_many :houses, :through => :cities
end
So far so good. Yet, I want to know all the people living in a country.
Creating the following has_many :through relation yields an error on
call: has_many :people, :through => :houses in the Country class. With
the abovementioned code this is only possible by iterating through all
coutry.houses and collecting the house.people.
Aparently in 2006 and 2007 alot of people walked into the same problems,
yet in Rails 2.1.0 I am still unable to make said relation. Is this bug
still not fixed, or am I doing something wrong in calling it?