From efb55d1cf50ba895b2811424b8df5e65f1205a66 Mon Sep 17 00:00:00 2001 From: David Heinemeier Hansson Date: Sun, 3 Apr 2005 12:06:23 +0000 Subject: Allow order, conditions, and joins in finds that include associations git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1080 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activerecord/test/associations_test.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'activerecord/test') diff --git a/activerecord/test/associations_test.rb b/activerecord/test/associations_test.rb index 68245379ed..e1a05e481b 100755 --- a/activerecord/test/associations_test.rb +++ b/activerecord/test/associations_test.rb @@ -539,6 +539,10 @@ class HasManyAssociationsTest < Test::Unit::TestCase posts = Post.find(:all, :include => :comments) assert_equal 2, posts.first.comments.size assert_equal @greetings.body, posts.first.comments.first.body + + post = Post.find(:first, :include => :comments, :conditions => "posts.title = 'Welcome to the weblog'") + assert_equal 2, post.comments.size + assert_equal @greetings.body, post.comments.first.body end def test_eager_association_loading_with_multiple_associations -- cgit v1.2.3