提交 2550acc7 编写于 作者: A Aaron Patterson

decouple the `join_constraints` method from the parent pointer

上级 cc362fe1
......@@ -80,7 +80,7 @@ def merge_outer_joins!(other)
end
def join_constraints
join_root.children.flat_map { |c| c.flat_map(&:join_constraints) }
make_joins join_root
end
def columns
......@@ -111,6 +111,12 @@ def instantiate(result_set)
private
def make_joins(node)
node.children.flat_map { |child|
child.join_constraints(node).concat make_joins(child)
}
end
def merge_node(left, right)
intersection, missing = right.children.map { |node1|
[left.children.find { |node2| node1.match? node2 }, node1]
......
......@@ -38,7 +38,7 @@ def match?(other)
super && reflection == other.reflection
end
def join_constraints
def join_constraints(parent)
joins = []
tables = @tables.dup
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册