diff options
Diffstat (limited to 'activerecord/lib/active_record/associations/join_dependency.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/join_dependency.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/join_dependency.rb b/activerecord/lib/active_record/associations/join_dependency.rb index 030049d000..ad7c978ff2 100644 --- a/activerecord/lib/active_record/associations/join_dependency.rb +++ b/activerecord/lib/active_record/associations/join_dependency.rb @@ -166,7 +166,9 @@ module ActiveRecord def make_joins(node) node.children.flat_map { |child| chain = child.reflection.chain - child.join_constraints(node, child.join_type, child.tables, chain) + foreign_table = node.table + foreign_klass = node.base_klass + child.join_constraints(foreign_table, foreign_klass, child.join_type, child.tables, chain) .concat make_joins(child) } end |