diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2018-06-14 23:48:01 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2018-06-19 22:21:51 +0900 |
commit | 15e3e9cdccd8ab0d204ed9e74bf7916d6025d405 (patch) | |
tree | 2b5588e1f5936fabd7ee6b12a883b00799ce7f81 /activerecord/test/fixtures | |
parent | 2be5ef6a1d5baebcb749c42a48628c741570fd73 (diff) | |
download | rails-15e3e9cdccd8ab0d204ed9e74bf7916d6025d405.tar.gz rails-15e3e9cdccd8ab0d204ed9e74bf7916d6025d405.tar.bz2 rails-15e3e9cdccd8ab0d204ed9e74bf7916d6025d405.zip |
Ensure to calculate column aliases after all table aliases are constructed
Currently, column aliases which is used for eager loading are calculated
before constructing all table aliases in FROM clause.
`JoinDependency#join_constraints` constructs table aliases for `joins`
first, and then always re-constructs table aliases for eager loading.
If both `joins` and eager loading are given a same table association,
the re-construction would cause the discrepancy between column aliases
and table aliases.
To avoid the discrepancy, the column aliases should be calculated after
all table aliases are constructed.
Fixes #30603.
Diffstat (limited to 'activerecord/test/fixtures')
-rw-r--r-- | activerecord/test/fixtures/memberships.yml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/fixtures/memberships.yml b/activerecord/test/fixtures/memberships.yml index a5d52bd438..f7ca227533 100644 --- a/activerecord/test/fixtures/memberships.yml +++ b/activerecord/test/fixtures/memberships.yml @@ -26,6 +26,13 @@ blarpy_winkup_crazy_club: favourite: false type: CurrentMembership +super_membership_of_boring_club: + joined_on: <%= 3.weeks.ago.to_s(:db) %> + club: boring_club + member_id: 1 + favourite: false + type: SuperMembership + selected_membership_of_boring_club: joined_on: <%= 3.weeks.ago.to_s(:db) %> club: boring_club |