aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2019-02-10 09:04:10 +0900
committerRyuta Kamizono <kamipo@gmail.com>2019-02-10 09:04:10 +0900
commit5e493c3b839f10d639f5cce1f1b9ff9292702821 (patch)
tree612e398a59ed9234bddc4fce5249be963b71822a /activerecord
parentc83254db7ad2dbcc73b3eb1e103ba2bae666ab91 (diff)
downloadrails-5e493c3b839f10d639f5cce1f1b9ff9292702821.tar.gz
rails-5e493c3b839f10d639f5cce1f1b9ff9292702821.tar.bz2
rails-5e493c3b839f10d639f5cce1f1b9ff9292702821.zip
Fix random CI failure due to non-deterministic sorting order
https://travis-ci.org/rails/rails/jobs/491045821#L1528-L1531
Diffstat (limited to 'activerecord')
-rw-r--r--activerecord/test/cases/associations/cascaded_eager_loading_test.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb
index a9e22c7643..b9e16cab21 100644
--- a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb
+++ b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb
@@ -18,7 +18,7 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase
:categorizations, :people, :categories, :edges, :vertices
def test_eager_association_loading_with_cascaded_two_levels
- authors = Author.all.merge!(includes: { posts: :comments }, order: "authors.id").to_a
+ authors = Author.includes(posts: :comments).order(:id).to_a
assert_equal 3, authors.size
assert_equal 5, authors[0].posts.size
assert_equal 3, authors[1].posts.size
@@ -26,7 +26,7 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase
end
def test_eager_association_loading_with_cascaded_two_levels_and_one_level
- authors = Author.all.merge!(includes: [{ posts: :comments }, :categorizations], order: "authors.id").to_a
+ authors = Author.includes({ posts: :comments }, :categorizations).order(:id).to_a
assert_equal 3, authors.size
assert_equal 5, authors[0].posts.size
assert_equal 3, authors[1].posts.size
@@ -36,7 +36,7 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase
end
def test_eager_association_loading_with_hmt_does_not_table_name_collide_when_joining_associations
- authors = Author.joins(:posts).eager_load(:comments).where(posts: { tags_count: 1 }).to_a
+ authors = Author.joins(:posts).eager_load(:comments).where(posts: { tags_count: 1 }).order(:id).to_a
assert_equal 3, assert_no_queries { authors.size }
assert_equal 10, assert_no_queries { authors[0].comments.size }
end