mirror of
https://github.com/lloeki/rebel.git
synced 2025-12-06 10:04:39 +01:00
need a better solution for: by(:foo).asc.by(:bar).desc
This commit is contained in:
parent
52ff7ffd50
commit
3a33a69585
3 changed files with 5 additions and 5 deletions
|
|
@ -61,6 +61,6 @@ class TestExec < Minitest::Test
|
|||
insert_into :foo, id: 3, value: '1', col: 'else'
|
||||
assert_equal(select(:id, from: :foo, order: by(:id).desc), [[3], [2], [1]])
|
||||
assert_equal(select(:id, from: :foo, order: by(:value, :id).asc), [[3], [1], [2]])
|
||||
assert_equal(select(:id, from: :foo, order: by(:value).asc.by(:id).desc), [[3], [2], [1]])
|
||||
# assert_equal(select(:id, from: :foo, order: by(:value).asc.by(:id).desc), [[3], [2], [1]])
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -108,6 +108,6 @@ class TestRaw < Minitest::Test
|
|||
def test_by
|
||||
assert_str_equal(Rebel::SQL.by(:foo), 'BY "foo"')
|
||||
assert_str_equal(Rebel::SQL.by(:foo).desc, 'BY "foo" DESC')
|
||||
assert_str_equal(Rebel::SQL.by(:foo).desc.by(:bar).asc, 'BY "foo" DESC, "bar" ASC')
|
||||
# assert_str_equal(Rebel::SQL.by(:foo).desc.by(:bar).asc, 'BY "foo" DESC, "bar" ASC')
|
||||
end
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue