diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-13 18:01:18 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2013-10-13 18:01:18 -0700 |
commit | 71250a5ae575277379cc4fabf62baf60583ee0b9 (patch) | |
tree | 8887d77cc90009046dc904f2ef1478818fd65101 /activerecord | |
parent | a11882ce405878d61e7edb8e7553980605e167c9 (diff) | |
download | rails-71250a5ae575277379cc4fabf62baf60583ee0b9.tar.gz rails-71250a5ae575277379cc4fabf62baf60583ee0b9.tar.bz2 rails-71250a5ae575277379cc4fabf62baf60583ee0b9.zip |
unhook `join_constraints` from the @tables ivar
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 2 | ||||
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency/join_association.rb | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index ad1776fa5a..4635601781 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -119,7 +119,7 @@ module ActiveRecord def make_joins(node) node.children.flat_map { |child| - child.join_constraints(node).concat make_joins(child) + child.join_constraints(node, child.tables).concat make_joins(child) } end diff --git a/activerecord/lib/active_record/associations/join_dependency/join_association.rb b/activerecord/lib/active_record/associations/join_dependency/join_association.rb index d497709671..c6b45198ce 100644 --- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb +++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb @@ -33,9 +33,9 @@ module ActiveRecord super && reflection == other.reflection end - def join_constraints(parent) + def join_constraints(parent, tables) joins = [] - tables = @tables.dup + tables = tables.dup foreign_table = parent.table foreign_klass = parent.base_klass |