I have a model called User which has_one Player. A Player belongs_to a User.
I want to find all the Players which Users attributes City has a particular value. Right now I have this in my Player model:
def find
User.find(:all, :conditions => ['city LIKE ?', "%#{city}%"])
end
However that gives me the User. I want the Players which Users satisfy that condition.
How do I do that?
Try this.