diff options
author | David Genord II <david@xspond.com> | 2010-07-13 18:14:26 -0400 |
---|---|---|
committer | Pratik Naik <pratiknaik@gmail.com> | 2010-07-16 08:28:49 +0100 |
commit | 1fcf4e8ecbe4db2443a88d1e06c06667cff5b762 (patch) | |
tree | 8c7a7be386fdcc139142f9e5d7526dcfc4638119 /activerecord/test/cases/associations | |
parent | 181e0d326de8ce212d951d0e8a8ca0ba478ac5a4 (diff) | |
download | rails-1fcf4e8ecbe4db2443a88d1e06c06667cff5b762.tar.gz rails-1fcf4e8ecbe4db2443a88d1e06c06667cff5b762.tar.bz2 rails-1fcf4e8ecbe4db2443a88d1e06c06667cff5b762.zip |
JoinDependency#graft does not properly set parent join [#5124 state:resolved]
Signed-off-by: Pratik Naik <pratiknaik@gmail.com>
Diffstat (limited to 'activerecord/test/cases/associations')
-rw-r--r-- | activerecord/test/cases/associations/cascaded_eager_loading_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb index 9c5dcc2ad9..67eb6403c8 100644 --- a/activerecord/test/cases/associations/cascaded_eager_loading_test.rb +++ b/activerecord/test/cases/associations/cascaded_eager_loading_test.rb @@ -46,6 +46,13 @@ class CascadedEagerLoadingTest < ActiveRecord::TestCase assert_equal people(:michael), Person.eager_load(:primary_contact => :primary_contact).where('primary_contacts_people_2.first_name = ?', 'Susan').order('people.id').first end + def test_eager_associatoin_loading_with_join_for_count + authors = Author.joins(:special_posts).includes([:posts, :categorizations]) + + assert_nothing_raised { authors.count } + assert_queries(3) { authors.all } + end + def test_eager_association_loading_with_cascaded_two_levels_with_two_has_many_associations authors = Author.find(:all, :include=>{:posts=>[:comments, :categorizations]}, :order=>"authors.id") assert_equal 2, authors.size |