Left outer join inside another?

I have three tables

“kids” which belongs_to “families” which belongs “group”
I want to get all the kids from a certain group

I have my models

class Kid < ActiveRecord::Base
belongs_to :family

class Family < ActiveRecord::Base
belongs_to :group

in my controller I’m trying

@kids = Kid.find(:all, :include => [:family],:conditions=>["
‘group.country’=? ", params[:id]])

Do I have to add to the include " :include => [:family,:group]
" ?
Or do I have to add something the Kid model ?


This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs