Search for users through an associated table via ActiveRecord
I'm building an app in Rails 2.3.18 and I'm trying to find all users who
have specific attributes on their profiles. This is found for an
individual user by user.profile. User profiles have columns on them like
first_name, last_name, birthday, etc.
I'm trying to devise an ActiveRecord query to find all of the users who
all have a certain first name, for example.
Something like:
User.find(:where => {:first_name => "Tom"})
How should I format this query?
No comments:
Post a Comment