mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
select manager responds to order
This commit is contained in:
parent
a0772a8d9c
commit
e4f6272b84
2 changed files with 11 additions and 0 deletions
|
@ -37,6 +37,10 @@ module Arel
|
|||
end
|
||||
end
|
||||
|
||||
def order *expr
|
||||
tm.order *expr
|
||||
end
|
||||
|
||||
def where condition
|
||||
tm.where condition
|
||||
end
|
||||
|
|
|
@ -30,6 +30,13 @@ module Arel
|
|||
end
|
||||
end
|
||||
|
||||
describe 'order' do
|
||||
it "should take an order" do
|
||||
manager = @relation.order "foo"
|
||||
manager.to_sql.should be_like %{ SELECT FROM "users" ORDER BY foo }
|
||||
end
|
||||
end
|
||||
|
||||
describe 'take' do
|
||||
it "should add a limit" do
|
||||
manager = @relation.take 1
|
||||
|
|
Loading…
Reference in a new issue