Permalink
Browse files

Use order to get the first record since postgresql returns in the

desired order
  • Loading branch information...
1 parent 3143620 commit a0d84227c2aa4f509abcfa81880dc1cd7cfa9d05 @rafaelfranca rafaelfranca committed Feb 21, 2013
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/test/cases/associations/eager_test.rb
@@ -1114,7 +1114,7 @@ def test_join_eager_with_nil_order_should_generate_valid_sql
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

0 comments on commit a0d8422

Please sign in to comment.