Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unhook `join_constraints` from the @tables ivar

  • Loading branch information...
commit 71250a5ae575277379cc4fabf62baf60583ee0b9 1 parent a11882c
@tenderlove tenderlove authored
View
2  activerecord/lib/active_record/associations/join_dependency.rb
@@ -119,7 +119,7 @@ def instantiate(result_set)
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
View
4 activerecord/lib/active_record/associations/join_dependency/join_association.rb
@@ -33,9 +33,9 @@ def match?(other)
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
Please sign in to comment.
Something went wrong with that request. Please try again.