Hello,
I have a relationship in which a post belongs to the city which inturn belongs to a state like:
class Post < ActiveRecord::Base
belongs_to :city
end
class City < ActiveRecord::Base
belongs_to :state
end
Now i want to find all the posts along with the their cities and the states to which the belong to. I wrote the following query to fetch the posts with their cities but out of ideas on how to fetch the corresponding state with the city in the same finder:
@post = Post.find :all, :include => [:city]
Any help is appreciated.
Thanks.