here is a simple structure:
class Dinner
belongs_to :user
field :name
class User
has_many :dinners
field :name
now, what i want is to find all the dinners hosted by 'John'. looking for something like:
Dinner.where('user.name' => 'john')
the problem is that i cannot find any way to query by referenced attribute. any suggestions?
nameattrubute