diff options
author | Pratik Naik <pratiknaik@gmail.com> | 2009-12-26 14:40:45 +0530 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2009-12-26 14:40:45 +0530 |
commit | 9d3d60c64a9ce69b9932f5c543112199e576c2ad (patch) | |
tree | 6cc2d5fbf8f707274683a93cda8ac32b175b7663 /activerecord/test/cases/relations_test.rb | |
parent | 284d186cf4e055cefb2f8482d016e3bd09e9c341 (diff) | |
download | rails-9d3d60c64a9ce69b9932f5c543112199e576c2ad.tar.gz rails-9d3d60c64a9ce69b9932f5c543112199e576c2ad.tar.bz2 rails-9d3d60c64a9ce69b9932f5c543112199e576c2ad.zip |
Ensure preload and eager_load finder methods accept multiple arguments
Diffstat (limited to 'activerecord/test/cases/relations_test.rb')
-rw-r--r-- | activerecord/test/cases/relations_test.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/activerecord/test/cases/relations_test.rb b/activerecord/test/cases/relations_test.rb index 50bd221bb3..d0a28c58e0 100644 --- a/activerecord/test/cases/relations_test.rb +++ b/activerecord/test/cases/relations_test.rb @@ -116,22 +116,28 @@ class RelationTest < ActiveRecord::TestCase def test_find_with_included_associations assert_queries(2) do posts = Post.preload(:comments) - posts.first.comments.first + assert posts.first.comments.first end assert_queries(2) do posts = Post.preload(:comments).to_a - posts.first.comments.first + assert posts.first.comments.first end assert_queries(2) do posts = Post.preload(:author) - posts.first.author + assert posts.first.author end assert_queries(2) do posts = Post.preload(:author).to_a - posts.first.author + assert posts.first.author + end + + assert_queries(3) do + posts = Post.preload(:author, :comments).to_a + assert posts.first.author + assert posts.first.comments.first end end |