Rails joins through association

Use nested joins

Employer.joins({:people => {:household => {:suburb => :city}}}) 

should give you the join table you’re looking. If you were traversing the other direction you would use plural names

City.joins( :suburbs => {:households => {:people => :employers }})

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)