mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 01:54:40 +01:00
parens handling for where
This commit is contained in:
parent
814aa46592
commit
e9ee35f68e
2 changed files with 27 additions and 11 deletions
|
|
@ -52,4 +52,9 @@ class TestRaw < Minitest::Test
|
|||
def test_in
|
||||
assert_str_equal(Rebel::SQL.name(:foo).in(1, 2, 3), '"foo" IN (1, 2, 3)')
|
||||
end
|
||||
|
||||
def test_where
|
||||
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
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue