diff options
author | siddharth@vinsol.com <siddharth@vinsol.com> | 2014-11-20 01:35:04 +0530 |
---|---|---|
committer | siddharth@vinsol.com <siddharth@vinsol.com> | 2014-11-21 21:13:11 +0530 |
commit | 91e3dab804fffe0b1daebb438091418faa1fa256 (patch) | |
tree | 9ac7acc6a00c82e787cb010d15d9c9be666fa667 /activerecord/test/cases | |
parent | 7e375afba30951b60a3e606ccbfe3f28b0df5e1a (diff) | |
download | rails-91e3dab804fffe0b1daebb438091418faa1fa256.tar.gz rails-91e3dab804fffe0b1daebb438091418faa1fa256.tar.bz2 rails-91e3dab804fffe0b1daebb438091418faa1fa256.zip |
Fix includes on association with a scope containing joins along with conditions
on the joined assoiciation
Diffstat (limited to 'activerecord/test/cases')
-rw-r--r-- | activerecord/test/cases/associations/eager_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/eager_test.rb b/activerecord/test/cases/associations/eager_test.rb index 4539b99504..dd4f530791 100644 --- a/activerecord/test/cases/associations/eager_test.rb +++ b/activerecord/test/cases/associations/eager_test.rb @@ -904,6 +904,12 @@ class EagerAssociationTest < ActiveRecord::TestCase assert_no_queries {assert_equal posts(:sti_comments), comment.post} end + def test_eager_association_with_scope_with_joins + assert_nothing_raised do + Post.includes(:very_special_comment_with_post_with_joins).to_a + end + end + def test_preconfigured_includes_with_has_many posts = authors(:david).posts_with_comments one = posts.detect { |p| p.id == 1 } |