Skip to content

Fix left joins order when merging multiple left joins from different associations#39268

Merged
kamipo merged 1 commit intorails:masterfrom
kamipo:fix_merging_multiple_left_joins
May 13, 2020
Merged

Fix left joins order when merging multiple left joins from different associations#39268
kamipo merged 1 commit intorails:masterfrom
kamipo:fix_merging_multiple_left_joins

Conversation

@kamipo
Copy link
Copy Markdown
Member

@kamipo kamipo commented May 13, 2020

#38597 is caused by #35864.

To reproduce this issue, at least it is required four different models
and three left joins from different relations.

When merging a relation from different model, new stashed (left) joins
should be placed before existing stashed joins, but #35864 had broken
that expectation if left joins are stashed multiple times.

This fixes that stashed left joins order as expected.

Fixes #38597.

…associations

rails#38597 is caused by rails#35864.

To reproduce this issue, at least it is required four different models
and three left joins from different relations.

When merging a relation from different model, new stashed (left) joins
should be placed before existing stashed joins, but rails#35864 had broken
that expectation if left joins are stashed multiple times.

This fixes that stashed left joins order as expected.

Fixes rails#38597.
@kamipo kamipo merged commit 1c3e75b into rails:master May 13, 2020
@kamipo kamipo deleted the fix_merging_multiple_left_joins branch May 13, 2020 21:22
kamipo added a commit that referenced this pull request May 13, 2020
Fix left joins order when merging multiple left joins from different associations
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

The join order of tables has been changed in Rails6

1 participant