From a0d84227c2aa4f509abcfa81880dc1cd7cfa9d05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 20 Feb 2013 22:31:02 -0300 Subject: Use order to get the first record since postgresql returns in the desired order --- activerecord/test/cases/associations/eager_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index c125b89aee..944f135153 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -1114,7 +1114,7 @@ class EagerAssociationTest < ActiveRecord::TestCase end test "preloading does not cache has many association subset when preloaded with a through association" do - author = Author.where(:id => 1).includes(:comments_with_order_and_conditions, :posts).first + author = Author.order(:id).includes(:comments_with_order_and_conditions, :posts).first assert_no_queries { assert_equal 2, author.comments_with_order_and_conditions.size } assert_no_queries { assert_equal 5, author.posts.size, "should not cache a subset of the association" } end -- cgit v1.2.3