I have the following models: I have to find all posts that belong to groups where user is a member. I have made it with this method: but it produces unefficient SQL: I want to make a query like this: How can I do this without using raw SQL? Answer something like this should work for you, although it requires