diff options
-rw-r--r-- | activerecord/lib/active_record/associations/association_scope.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/association_scope.rb b/activerecord/lib/active_record/associations/association_scope.rb index 26fed22b4c..b58c902bfc 100644 --- a/activerecord/lib/active_record/associations/association_scope.rb +++ b/activerecord/lib/active_record/associations/association_scope.rb @@ -135,9 +135,9 @@ module ActiveRecord tables = construct_tables(chain, assoc_klass, refl, tracker) - reflection = chain.last + a_reflection = chain.last table = tables.last - scope = last_chain_scope(scope, table, reflection, owner, tracker, assoc_klass) + scope = last_chain_scope(scope, table, a_reflection, owner, tracker, assoc_klass) chain.each_with_index do |reflection, i| table, foreign_table = tables.shift, tables.first |