I'm trying to request some data with ActiveRecord with no success.
I have these models :
Sections have multiple Questions
Questions have one Answer
One Answer belongs to one User and one Question
So I would like request for a specified user, all Sections with linked Questions et linked Answer.
Maybe something like
Section.all.joins(:questions).joins(:answer).where(answer.user_id = USER_ID)
Thanks for any help !