As you can see the query sort of works, but not in the way it should.
A lot of aliases are created, the include is treated as a LEFT OUTER
JOIN and more columns are selected than the ones I specify. So well,
here I leave it and hope someone has noticed this too so we can work
on it.
That's how include works when it thinks you are referencing included
tables. unfortunately it doesn't scan the joins clause and so it
thinks its needs to use the joins version of :include.
Are there any plans to solve this issue? How can anyone work around
this problem? Imagine I want to include also the pictures related to
the events, event_category etc...What approach should someone take?
The query generated is far from what it should be. Thanks,
Are there any plans to solve this issue? How can anyone work around
this problem? Imagine I want to include also the pictures related to
the events, event_category etc...What approach should someone take?
The query generated is far from what it should be. Thanks,
The key thing is that it is hard to parse the joins fragment. In terms
of plans to fix it, I'm sure a patch fixing this would be welcomed.
It may be more practical in your case to do this in two goes, ie
locate the relevant events and then do Event.find
some_list_of_ids, :include => ...
ANother thing I've been playing around with is the ability to do