D For A Web Developer
via Digitalmars-d
digitalmars-d at puremagic.com
Thu May 1 12:55:06 PDT 2014
On Thursday, 1 May 2014 at 18:35:40 UTC, Jacob Carlborg wrote:
> On 2014-05-01 15:54, "Marc Schütz" <schuetzm at 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.
More information about the Digitalmars-d
mailing list