提交 c6bfd680 编写于 作者: S Santiago Pastorino 提交者: Aaron Patterson

When use where more than once on the same column, relation doesn't do an 'or'...

When use where more than once on the same column, relation doesn't do an 'or' or 'in' with the values
上级 00693209
......@@ -451,6 +451,15 @@ def test_find_by_id_with_list_of_ar
assert_equal author, authors
end
def test_find_all_using_where_twice_should_or_the_relation
david = authors(:david)
relation = Author.unscoped
relation = relation.where(:name => david.name)
relation = relation.where(:name => 'Santiago')
relation = relation.where(:id => david.id)
assert_equal [david], relation.all
end
def test_exists
davids = Author.where(:name => 'David')
assert davids.exists?
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册