diff options
author | Ryuta Kamizono <kamipo@gmail.com> | 2017-09-02 18:25:47 +0900 |
---|---|---|
committer | Ryuta Kamizono <kamipo@gmail.com> | 2017-09-02 18:25:47 +0900 |
commit | 9ca873d222b9bf7a2d394b24df4cca66fbcc0423 (patch) | |
tree | cfd8457517ebc5e9b7cd5312158df17fbbeba3b8 /activerecord | |
parent | fe32dc8e9323d04fff9fa486ada70167e1d95536 (diff) | |
download | rails-9ca873d222b9bf7a2d394b24df4cca66fbcc0423.tar.gz rails-9ca873d222b9bf7a2d394b24df4cca66fbcc0423.tar.bz2 rails-9ca873d222b9bf7a2d394b24df4cca66fbcc0423.zip |
Don't expose `find_all_ordered` utility method in tests
Because this is not a test case.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 3fd2c73efc..559f0e9338 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -869,10 +869,6 @@ class EagerAssociationTest < ActiveRecord::TestCase end end - def find_all_ordered(className, include = nil) - className.all.merge!(order: "#{className.table_name}.#{className.primary_key}", includes: include).to_a - end - def test_limited_eager_with_order assert_equal( posts(:thinking, :sti_comments), @@ -1510,4 +1506,9 @@ class EagerAssociationTest < ActiveRecord::TestCase ActiveRecord::Associations::HasManyAssociation.any_instance.expects(:reader).never Author.preload(:readonly_comments).first! end + + private + def find_all_ordered(klass, include = nil) + klass.order("#{klass.table_name}.#{klass.primary_key}").includes(include).to_a + end end |