search for: massachuset

Displaying 1 result from an estimated 1 matches for "massachuset".

Did you mean: massachusets
2006 Apr 04
4
Find records based on associated table''s colums
Hello, Let''s say I have a model for a "house". Each house has_a "city", which in turn has_a "state" which in turn has_a "country". The objective is to retrieve all houses in a given state, say "Massachusetts". Being new to Ruby on Rails what I like is that things that should be simple usually are simple, and since we have easy access to associated tables via properties, I would expect to be able to write something like this: House.find(:all, conditions => [house.city.state.name == "Mas...