diff options
author | Joe Hannon <ziggurism@gmail.com> | 2010-05-02 16:26:02 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2010-12-14 15:56:39 -0800 |
commit | 00c893d3b86be3a141c21ed065e085adbb26062a (patch) | |
tree | 0553b1c7a26b77c20aada9035c639453e668efeb /activerecord | |
parent | f2234a5dd3a1d891e585a703f1a432153e4d2c18 (diff) | |
download | rails-00c893d3b86be3a141c21ed065e085adbb26062a.tar.gz rails-00c893d3b86be3a141c21ed065e085adbb26062a.tar.bz2 rails-00c893d3b86be3a141c21ed065e085adbb26062a.zip |
add test which fails for has_many through self join [#4361 state:open]
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/test/cases/associations/has_many_through_associations_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/activerecord/test/cases/associations/has_many_through_associations_test.rb b/activerecord/test/cases/associations/has_many_through_associations_test.rb index 52432b0428..fe60e676d6 100644 --- a/activerecord/test/cases/associations/has_many_through_associations_test.rb +++ b/activerecord/test/cases/associations/has_many_through_associations_test.rb @@ -388,6 +388,13 @@ class HasManyThroughAssociationsTest < ActiveRecord::TestCase ].each {|block| assert_raise(ActiveRecord::HasManyThroughCantAssociateThroughHasOneOrManyReflection, &block) } end + def test_has_many_association_through_a_has_many_association_to_self + sarah = Person.create!(:first_name => 'Sarah', :primary_contact_id => people(:susan).id, :gender => 'F', :number1_fan_id => 1) + john = Person.create!(:first_name => 'John', :primary_contact_id => sarah.id, :gender => 'M', :number1_fan_id => 1) + assert_equal sarah.agents, [john] + assert_equal people(:susan).agents_of_agents, [john] + end + def test_collection_singular_ids_getter_with_string_primary_keys book = books(:awdr) assert_equal 2, book.subscriber_ids.size |