Environment: Rails 3.2.22
Question:
Lets say I have the models Topics
, Posts
, and User
.
Posts
belongs to Topics
User
has many Posts
I want to make a query of Topic.all
, but includes all posts associated to a user.
I've tried include
and eager_load
with a where condition for the user id, but only topics with a post which meets the condition are return.
What I want is all topics return and include only posts which match the user_id condition.