method
walk
v5.2.3 -
Show latest stable
- Class:
ActiveRecord::Associations::JoinDependency
walk(left, right)private
No documentation available.
# File activerecord/lib/active_record/associations/join_dependency.rb, line 177
def walk(left, right)
intersection, missing = right.children.map { |node1|
[left.children.find { |node2| node1.match? node2 }, node1]
}.partition(&:first)
joins = intersection.flat_map { |l, r| r.table = l.table; walk(l, r) }
joins.concat missing.flat_map { |_, n| make_constraints(left, n) }
end