diff options
author | Jon Leighton <j@jonathanleighton.com> | 2010-10-02 18:50:17 +0100 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2010-10-02 18:50:17 +0100 |
commit | 34ee586e993ad9e466b81f376fa92feb5d312b4c (patch) | |
tree | 5ab70bda381aeb9f068d970a517801ebd06f8e49 /activerecord/test | |
parent | 4f69a61107d9d59f96bf249ef077483e90babe72 (diff) | |
download | rails-34ee586e993ad9e466b81f376fa92feb5d312b4c.tar.gz rails-34ee586e993ad9e466b81f376fa92feb5d312b4c.tar.bz2 rails-34ee586e993ad9e466b81f376fa92feb5d312b4c.zip |
Integrate nested support into ThroughAssociationScope, using my concept of generating a 'chain' of reflections to be joined. It seems to work at the moment, all existing tests are passing. There may be further complications as we add more test cases for nested associations, though.
Diffstat (limited to 'activerecord/test')
-rw-r--r-- | activerecord/test/cases/associations/nested_has_many_through_associations_test.rb | 24 |
1 files changed, 12 insertions, 12 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 539e6e000a..938643b1b3 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 @@ -21,23 +21,23 @@ require 'models/subscription' class NestedHasManyThroughAssociationsTest < ActiveRecord::TestCase fixtures :authors, :books, :posts, :subscriptions, :subscribers, :tags, :taggings -# def test_has_many_through_a_has_many_through_association_on_source_reflection -# author = authors(:david) -# assert_equal [tags(:general), tags(:general)], author.tags -# end + def test_has_many_through_a_has_many_through_association_on_source_reflection + author = authors(:david) + assert_equal [tags(:general), tags(:general)], author.tags + end def test_has_many_through_a_has_many_through_association_on_through_reflection author = authors(:david) assert_equal [subscribers(:first), subscribers(:second), subscribers(:second)], author.subscribers end -# def test_distinct_has_many_through_a_has_many_through_association_on_source_reflection -# author = authors(:david) -# assert_equal [tags(:general)], author.distinct_tags -# end + def test_distinct_has_many_through_a_has_many_through_association_on_source_reflection + author = authors(:david) + assert_equal [tags(:general)], author.distinct_tags + end -# def test_distinct_has_many_through_a_has_many_through_association_on_through_reflection -# author = authors(:david) -# assert_equal [subscribers(:first), subscribers(:second)], author.distinct_subscribers -# end + def test_distinct_has_many_through_a_has_many_through_association_on_through_reflection + author = authors(:david) + assert_equal [subscribers(:first), subscribers(:second)], author.distinct_subscribers + end end |