How to make squeel generate RIGHT OUTER JOIN?
This:
User.joins{comment.outer}
generates LEFT OUTER JOIN.
No, I cannot do Comment.joins{user.outer}
, the whole query is much more complicated and I must start it with User
.
If not in squeel maybe someone knows the other Rails-way to prepare such query?
EDIT:
Thank's @cpuguy83. I tried solution from the first comment, but it's not so simple. The right join I'm trying to do is just the beginning of chain query. I need another calls to joins
to join relations that are connected through Comment
. Unfortunately, if I do something like this:
User.joins("right outer join comments").joins(comments: :author)
I get the comments
relation joined twice: once by first call to joins, and once by the second one. Is there a way to solve it, or I should switch to another call to joins
with raw SQL JOIN
statement?