diff options
author | Yves Senn <yves.senn@gmail.com> | 2013-02-19 14:42:45 +0100 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2013-02-19 14:42:45 +0100 |
commit | 9be7f63db9063b004bc0645df1d49e23ee3ccae9 (patch) | |
tree | 33326c5ebad5df43f69321a02569287b27143b81 /activerecord | |
parent | b4e053e867232e28c7b99b0d935161d1e4559ced (diff) | |
download | rails-9be7f63db9063b004bc0645df1d49e23ee3ccae9.tar.gz rails-9be7f63db9063b004bc0645df1d49e23ee3ccae9.tar.bz2 rails-9be7f63db9063b004bc0645df1d49e23ee3ccae9.zip |
keep the build :green_heart:, #first on 1.8.7 and pg is different
The build only failed for ruby-1.8.7 and pg. The problem was that the statement:
```ruby
author = Author.includes(:comments_with_order_and_conditions, :posts).first
```
resulted in Author with ID 2 where on all other rubies / db-engines Author with ID 1
was retunred. Of course this breaks the assertions.
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 2 |
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 5d07ffa241..c125b89aee 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.includes(:comments_with_order_and_conditions, :posts).first + author = Author.where(:id => 1).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 |