fix hash clause handling

This commit is contained in:
Loic Nageleisen 2017-03-01 16:48:09 +01:00
parent d538a9b584
commit 8a9b5804fc
2 changed files with 2 additions and 0 deletions

View file

@ -54,6 +54,7 @@ class TestRaw < Minitest::Test
end
def test_where
assert_str_equal(Rebel::SQL.where?(foo: 1, bar: 2, baz: 3), 'WHERE "foo" = 1 AND "bar" = 2 AND "baz" = 3')
assert_str_equal(Rebel::SQL.where?(Rebel::SQL.name(:foo).eq(1).or(Rebel::SQL.name(:bar).eq(2)), Rebel::SQL.name(:baz).eq(3)), 'WHERE ("foo" = 1 OR "bar" = 2) AND "baz" = 3')
assert_str_equal(Rebel::SQL.where?(Rebel::SQL.name(:foo).eq(1).or(Rebel::SQL.name(:bar).eq(2))), 'WHERE "foo" = 1 OR "bar" = 2')
end