Maybe the other way around...
class Company
has_many :surveys
def survey_answers
SurveyAnswer.all(:joins => {:survey_question => {:survey
=> :company}},
:conditions => ['companies.id = :company_id',
{:company_id => id}])
end
end
Greetings,
Wojtek
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---