You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
codeodor
changed the title
Rails 6.0 switches order of joined queries when combining includes and joins
Rails 6.0 switches order of joined queries when combining includes and joins (causing errors)
Sep 4, 2019
If a relation has eager_load and string joins only, string joins will be
regarded as leading joins unlike before, due to rails#36805.
To maintain that joining order as before, check eager loading join
first before string joins.
Fixesrails#37133.
I think this is due to / related to #36834
Steps to reproduce
I used @eileencodes script from the pull request above, modified to illustrate my issue:
Expected behavior
The query should work as it did in Rails 5.2.3 by having the first join be the includes/references join.
Actual behavior
The query puts the includes/references join at the end, so that the
joins
that reference it fail.System configuration
Rails version: 6.0.0
Ruby version: 2.5.0
cc @kamipo (as author of the related pull request)
The text was updated successfully, but these errors were encountered: