aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorAaron Patterson <aaron.patterson@gmail.com>2013-10-13 18:01:18 -0700
committerAaron Patterson <aaron.patterson@gmail.com>2013-10-13 18:01:18 -0700
commit71250a5ae575277379cc4fabf62baf60583ee0b9 (patch)
tree8887d77cc90009046dc904f2ef1478818fd65101 /activerecord
parenta11882ce405878d61e7edb8e7553980605e167c9 (diff)
downloadrails-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.rb2
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb4
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