How can I do quiery on nested associations? Suppose, I want to select all the users who left a comment with “hello” in its body somewhere.
users = Blog.User
|> where([user], user.id == ^user_id)
|> join(:left, [user], cmt in assoc(user, :comments))
# ???? where cmt.contains?("hello")
# ...........
|> Blog.Repo.all()
How can I do that?