aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--activerecord/lib/active_record/associations/join_dependency.rb3
-rw-r--r--activerecord/lib/active_record/associations/join_dependency/join_association.rb2
2 files changed, 3 insertions, 2 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb
index 2ea8eb69d7..030049d000 100644
--- a/activerecord/lib/active_record/associations/join_dependency.rb
+++ b/activerecord/lib/active_record/associations/join_dependency.rb
@@ -165,7 +165,8 @@ module ActiveRecord
def make_joins(node)
node.children.flat_map { |child|
- child.join_constraints(node, child.tables, child.reflection.chain)
+ chain = child.reflection.chain
+ child.join_constraints(node, child.join_type, child.tables, chain)
.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 9677d1219a..9204fa3a56 100644
--- a/activerecord/lib/active_record/associations/join_dependency/join_association.rb
+++ b/activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -25,7 +25,7 @@ module ActiveRecord
super && reflection == other.reflection
end
- def join_constraints(parent, tables, chain)
+ def join_constraints(parent, join_type, tables, chain)
joins = []
tables = tables.reverse