提交 490d6f98 编写于 作者: A Aaron Patterson

Merged pull request #40 from gmile/master.

Passing nil in array generates improper SQL
......@@ -42,7 +42,17 @@ def in other
Nodes::Between.new(self, Nodes::And.new([other.begin, other.end]))
end
else
Nodes::In.new self, other
if other.include?(nil)
if other.size > 1
set = Nodes::In.new self, other.compact
null = Nodes::Equality.new self, nil
Nodes::Or.new set, null
else
Nodes::Equality.new self, nil
end
else
Nodes::In.new self, other
end
end
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册