Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
added ActiveRecord::Relation#left_outer_joins #12071
this adds the ability to use a
The ability to do this is already implemented in
User.outer_joins(:posts) => SELECT "users".* FROM "users" LEFT OUTER JOIN "posts" ON "posts"."user_id" = "users"."id"
Good point. If it's actually going to do an LOJ, the method should probably be
referenced this pull request
Apr 24, 2014
One thing I'd love to see but don't have a clear API for - the ability to specify additional bits in the
which would produce the SQL:
assuming there's a boolean
Note that the above is not equivalent to:
since that query doesn't include users who don't have any featured posts.
Without this feature, it would still be possible to create the desired SQL with a scoped association:
but that method doesn't exactly scale to arbitrary sets of conditions.
@al2o3cr +1. We should probably address that separately, afterwards, though... whatever we end up with seems like it should apply to