1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

adding "orders" method

This commit is contained in:
Aaron Patterson 2010-09-10 10:45:05 -07:00
parent 5eaf76df2d
commit e7648f2692
2 changed files with 14 additions and 0 deletions

View file

@ -89,6 +89,10 @@ module Arel
self
end
def orders
@head.orders
end
def wheres
Compatibility::Wheres.new @engine, @ctx.wheres
end

View file

@ -73,6 +73,16 @@ module Arel
end
end
describe 'orders' do
it 'returns order clauses' do
table = Table.new :users
manager = Arel::SelectManager.new Table.engine
order = table[:id]
manager.order table[:id]
check manager.orders.should == [order]
end
end
describe 'order' do
it 'generates order clauses' do
table = Table.new :users