diff options
-rw-r--r-- | lib/arel/table.rb | 4 | ||||
-rw-r--r-- | spec/arel/table_spec.rb | 7 |
2 files changed, 11 insertions, 0 deletions
diff --git a/lib/arel/table.rb b/lib/arel/table.rb index b3a1a105d8..f115caaab3 100644 --- a/lib/arel/table.rb +++ b/lib/arel/table.rb @@ -37,6 +37,10 @@ module Arel end end + def order *expr + tm.order *expr + end + def where condition tm.where condition end diff --git a/spec/arel/table_spec.rb b/spec/arel/table_spec.rb index 702608ed85..ae43183c67 100644 --- a/spec/arel/table_spec.rb +++ b/spec/arel/table_spec.rb @@ -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 |