`includes` uses SQL parsing when String joins are involved. #14226

Merged
merged 1 commit into from Feb 28, 2014

Projects

None yet

4 participants

@senny
Ruby on Rails member

Closes #14109

This is a partial revert of 22b3481.
The current implementation of references_eager_loaded_tables? needs to know
every table involved in the query. With the current API this is not possible
without SQL parsing.

While a2dab46 deprecated SQL parsing for includes.
It did not issue deprecation warnings when String joins are involved. This resulted
in a breaking change after the deprecated behavior was removed (22b3481).

We will need to rethink the usage of includes, preload and eager_load but for now,
this brings back the old working behavior.

@senny senny `includes` uses SQL parsing when String joins are involved.
This is a partial revert of 22b3481.
The current implementation of `references_eager_loaded_tables?` needs to know
every table involved in the query. With the current API this is not possible
without SQL parsing.

While a2dab46 deprecated SQL parsing for `includes`.
It did not issue deprecation warnings when String joins are involved. This resulted
in a breaking change after the deprecated behavior was removed (22b3481).

We will need to rethink the usage of `includes`, `preload` and `eager_load` but for now,
this brings back the old *working* behavior.
d1e7cd1
@senny
Ruby on Rails member

@tenderlove the partial revert is enough to resolve the issue described in #14109. This patch does not yet deprecate the usage of SQL parsing when String joins are involved. Let me know if prefer the full revert.

@senny senny added the activerecord label Feb 28, 2014
@senny senny added this to the 4.1.0 milestone Feb 28, 2014
@tenderlove tenderlove was assigned by senny Feb 28, 2014
@tenderlove
Ruby on Rails member

Nope, this seems great. Thanks for the work!

@tenderlove tenderlove merged commit 422906d into rails:master Feb 28, 2014

1 check failed

Details default The Travis CI build failed
@exviva

@senny how about backporting to 4-1-stable?

@senny
Ruby on Rails member

@exviva this patch was specifically written for 4.1 not sure if there is a reason why @tenderlove did not yet backport.

@chancancode
Ruby on Rails member
@tenderlove
Ruby on Rails member
@senny
Ruby on Rails member

@chancancode it's better if it's on master for the moment. We need to take a closer look how to proceed before removing anything.

@chancancode
Ruby on Rails member
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment