diff options
author | Matthew Draper <matthew@trebex.net> | 2014-09-04 21:33:40 +0930 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2014-09-04 21:33:40 +0930 |
commit | 4c23701d3d90ad8c471cff3dd623a9b3f8241b67 (patch) | |
tree | 5b0f8f941aa30db4fa5658e9868f0cbecc4f6c87 /activerecord/lib | |
parent | b8fbcc0787dde662049794ea4555c8aa52847843 (diff) | |
parent | 8dac515688e183d83192249e9552ac5042f9c593 (diff) | |
download | rails-4c23701d3d90ad8c471cff3dd623a9b3f8241b67.tar.gz rails-4c23701d3d90ad8c471cff3dd623a9b3f8241b67.tar.bz2 rails-4c23701d3d90ad8c471cff3dd623a9b3f8241b67.zip |
Merge pull request #16797 from eileencodes/refactor-add_constraints-followup-to-16762
Followup to PR #16762
Diffstat (limited to 'activerecord/lib')
-rw-r--r-- | activerecord/lib/active_record/associations/association_scope.rb | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index b58c902bfc..3a0ebba3e4 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -113,7 +113,7 @@ module ActiveRecord end end - def next_chain_scope(scope, table, reflection, chain, tracker, assoc_klass, foreign_table, next_reflection) + def next_chain_scope(scope, table, reflection, tracker, assoc_klass, foreign_table, next_reflection) join_keys = reflection.join_keys(assoc_klass) key = join_keys.key foreign_key = join_keys.foreign_key @@ -135,16 +135,16 @@ module ActiveRecord tables = construct_tables(chain, assoc_klass, refl, tracker) - a_reflection = chain.last + owner_reflection = chain.last table = tables.last - scope = last_chain_scope(scope, table, a_reflection, owner, tracker, assoc_klass) + scope = last_chain_scope(scope, table, owner_reflection, owner, tracker, assoc_klass) chain.each_with_index do |reflection, i| table, foreign_table = tables.shift, tables.first unless reflection == chain.last next_reflection = chain[i + 1] - scope = next_chain_scope(scope, table, reflection, chain, tracker, assoc_klass, foreign_table, next_reflection) + scope = next_chain_scope(scope, table, reflection, tracker, assoc_klass, foreign_table, next_reflection) end is_first_chain = i == 0 |