aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/test/cases/associations/eager_test.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2013-02-20 22:31:02 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2013-02-20 22:31:02 -0300
commita0d84227c2aa4f509abcfa81880dc1cd7cfa9d05 (patch)
treed79805ee9e437b43ce6e27262de5bd943f277ffb /activerecord/test/cases/associations/eager_test.rb
parent31436206d9fea09f6332d89e7863bc60e8db902f (diff)
downloadrails-a0d84227c2aa4f509abcfa81880dc1cd7cfa9d05.tar.gz
rails-a0d84227c2aa4f509abcfa81880dc1cd7cfa9d05.tar.bz2
rails-a0d84227c2aa4f509abcfa81880dc1cd7cfa9d05.zip
Use order to get the first record since postgresql returns in the
desired order
Diffstat (limited to 'activerecord/test/cases/associations/eager_test.rb')
-rw-r--r--activerecord/test/cases/associations/eager_test.rb2
1 files changed, 1 insertions, 1 deletions
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