aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
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