diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-06 17:17:49 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-09-06 17:17:49 -0700 |
commit | e4f6272b844f7e6a9ee13c67fdb80897377d2f44 (patch) | |
tree | 47ef8faca1af7523b4e6a9ccd36c44a9b2bc8071 | |
parent | a0772a8d9cedca1f8227fc63553c3baf92f7db4c (diff) | |
download | rails-e4f6272b844f7e6a9ee13c67fdb80897377d2f44.tar.gz rails-e4f6272b844f7e6a9ee13c67fdb80897377d2f44.tar.bz2 rails-e4f6272b844f7e6a9ee13c67fdb80897377d2f44.zip |
select manager responds to order
-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 |