diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-03 12:06:23 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-04-03 12:06:23 +0000 |
commit | efb55d1cf50ba895b2811424b8df5e65f1205a66 (patch) | |
tree | 4eefcc45a9abd0096c9166e6487febf8dfecbd97 /activerecord/test | |
parent | 4f6c943b05ea537be515ae6d70f8986191ef7e30 (diff) | |
download | rails-efb55d1cf50ba895b2811424b8df5e65f1205a66.tar.gz rails-efb55d1cf50ba895b2811424b8df5e65f1205a66.tar.bz2 rails-efb55d1cf50ba895b2811424b8df5e65f1205a66.zip |
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
Diffstat (limited to 'activerecord/test')
-rwxr-xr-x | activerecord/test/associations_test.rb | 4 |
1 files changed, 4 insertions, 0 deletions
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 |