diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-10-05 20:20:27 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-10-05 20:20:27 +0100 |
commit | 3cc35633872a0072764d8edb20f1fc4e14adf729 (patch) | |
tree | ea7bb015a0282987bd2fe69cf6b6767ef1a1ad30 /activerecord | |
parent | 43711083dd34252877bab9df43d3db0fd42feeb2 (diff) | |
download | rails-3cc35633872a0072764d8edb20f1fc4e14adf729.tar.gz rails-3cc35633872a0072764d8edb20f1fc4e14adf729.tar.bz2 rails-3cc35633872a0072764d8edb20f1fc4e14adf729.zip |
A failing test for a nested has many through association loaded via Foo.joins(:bar)
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/nested_has_many_through_associations_test.rb | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/nested_has_many_through_associations_test.rb b/activerecord/test/cases/associations/nested_has_many_through_associations_test.rb index 925a9598fb..a5d3f27702 100644 --- a/activerecord/test/cases/associations/nested_has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/nested_has_many_through_associations_test.rb @@ -45,4 +45,10 @@ class NestedHasManyThroughAssociationsTest < ActiveRecord::TestCase author = authors(:bob) assert_equal [posts(:misc_by_bob), posts(:misc_by_mary)], author.similar_posts.sort_by(&:id) end + + def test_nested_has_many_through_as_a_join + # All authors with subscribers where one of the subscribers' nick is 'alterself' + authors = Author.joins(:subscribers).where('subscribers.nick' => 'alterself') + assert_equal [authors(:david)], authors + end end |