diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-01 11:29:20 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2011-09-01 11:29:20 -0700 |
commit | 90248d2953789f8631480c767ebf3accdbda6a7a (patch) | |
tree | ec6d08695674e4d784ef88c86022cacda47a92fd /activerecord/test | |
parent | 7a7a3bcf02976b2dcfb262c781e68da3183d16e8 (diff) | |
parent | 0df27c98d982ec87d2fb48cfda82694eb267993e (diff) | |
download | rails-90248d2953789f8631480c767ebf3accdbda6a7a.tar.gz rails-90248d2953789f8631480c767ebf3accdbda6a7a.tar.bz2 rails-90248d2953789f8631480c767ebf3accdbda6a7a.zip |
Merge pull request #2775 from jaw6/fix/reverse
Fixes bug in ActiveRecord::QueryMethods, #1697
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index da96afd718..c3bad58174 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -934,6 +934,11 @@ class RelationTest < ActiveRecord::TestCase assert_equal 'zyke', FastCar.order_using_old_style.limit(1).first.name end + def test_order_with_function_and_last + authors = Author.scoped + assert_equal authors(:bob), authors.order( "id asc, COALESCE( organization_id, owned_essay_id)" ).last + end + def test_order_using_scoping car1 = CoolCar.order('id DESC').scoping do CoolCar.find(:first, :order => 'id asc') |