aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations
diff options
context:
space:
mode:
authorPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-08-21 10:49:18 +0300
committerPaul Nikitochkin <paul.nikitochkin@gmail.com>2013-09-04 11:57:39 +0300
commit3f1c0c2bd0b89255b0d7d8d6fe45ac2d50b05076 (patch)
tree3c40afa130e16284adeffbfddf6d0989d62cda4f /activerecord/test/cases/associations
parent6524a85fa5d34622c74de43ee1264f55d19910ff (diff)
downloadrails-3f1c0c2bd0b89255b0d7d8d6fe45ac2d50b05076.tar.gz
rails-3f1c0c2bd0b89255b0d7d8d6fe45ac2d50b05076.tar.bz2
rails-3f1c0c2bd0b89255b0d7d8d6fe45ac2d50b05076.zip
Extracted from `order` processing of arguments, and use it for `reorder` to be consistent.
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb7
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