On Thursday, 1 May 2014 at 18:35:40 UTC, Jacob Carlborg wrote:
On 2014-05-01 15:54, "Marc Schütz" <schue...@gmx.net>" wrote:

You can also use the built-in `includes()`, which does a LEFT OUTER JOIN:

    Post.includes(:comments).where(comments: {title: "bar"})

(It also eager-loads the comments, but this is usually desired anyway, because an OUTER JOIN doesn't make sense if you're not going to use the
joined records.)

The SQL code "includes" generates is unspecified. Sometimes it can do an extra "select" instead of a "join".

You're probably right. I thought that changed in a recent release, but can't find it anymore.

Reply via email to