Reputation:
I have 3 tables:
schools{id, name, desc, adress}
reviews{id, content, rating, school_id, user_id} # user_id & schoold_id is foregin keys
users{id, name, city}
How do I write a rails scope the joins all 3 tables and grab the column
the schools.name
, reviews.content
and reviews.rating
, the users.name
I am using rails 3.2
Upvotes: 3
Views: 2277