diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-09-04 02:00:09 -0700 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-09-04 02:00:09 -0700 |
commit | beb5ea8468e7f629b32252efd644bc68d1b34237 (patch) | |
tree | 51e5e8870fa04518aa6e493622e06cd9ed16f0be /activerecord/test/cases/associations | |
parent | 489a0890b6dbb8c7954e2a3b120fe31de64f156c (diff) | |
parent | 3f1c0c2bd0b89255b0d7d8d6fe45ac2d50b05076 (diff) | |
download | rails-beb5ea8468e7f629b32252efd644bc68d1b34237.tar.gz rails-beb5ea8468e7f629b32252efd644bc68d1b34237.tar.bz2 rails-beb5ea8468e7f629b32252efd644bc68d1b34237.zip |
Merge pull request #11958 from jetthoughts/extract_pre_process_orders_args
Re-use order arguments pre-processing for reorder
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 28bf48f4fd..8d3d6962fc 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1172,8 +1172,11 @@ class EagerAssociationTest < ActiveRecord::TestCase } end - test "works in combination with order(:symbol)" do - author = Author.includes(:posts).references(:posts).order(:name).where('posts.title IS NOT NULL').first + test "works in combination with order(:symbol) and reorder(:symbol)" do + author = Author.includes(:posts).references(:posts).order(:name).find_by('posts.title IS NOT NULL') + assert_equal authors(:bob), author + + author = Author.includes(:posts).references(:posts).reorder(:name).find_by('posts.title IS NOT NULL') assert_equal authors(:bob), author end end |