diff options
author | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-27 22:26:50 +0000 |
---|---|---|
committer | Jeremy Kemper <jeremy@bitsweat.net> | 2008-02-27 22:26:50 +0000 |
commit | 0d70f31057ff5cbdd7f62708a62ce846a1811f9c (patch) | |
tree | c1d9a3e9f018c59da6349795c4d5c103c1cee624 /activerecord | |
parent | c6a3a39feade3ad5340cd3edfecbd024eecf653a (diff) | |
download | rails-0d70f31057ff5cbdd7f62708a62ce846a1811f9c.tar.gz rails-0d70f31057ff5cbdd7f62708a62ce846a1811f9c.tar.bz2 rails-0d70f31057ff5cbdd7f62708a62ce846a1811f9c.zip |
Remove dead code from hmt#delete. Closes #11236 [rubyruy]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8932 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord')
-rw-r--r-- | activerecord/lib/active_record/associations/has_many_through_association.rb | 2 | ||||
-rw-r--r-- | activerecord/test/cases/associations/join_model_test.rb | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_many_through_association.rb b/activerecord/lib/active_record/associations/has_many_through_association.rb index 281db8fe06..19112216aa 100644 --- a/activerecord/lib/active_record/associations/has_many_through_association.rb +++ b/activerecord/lib/active_record/associations/has_many_through_association.rb @@ -83,7 +83,7 @@ module ActiveRecord raise_on_type_mismatch(associate) raise ActiveRecord::HasManyThroughCantDissociateNewRecords.new(@owner, through) unless associate.respond_to?(:new_record?) && !associate.new_record? - @owner.send(through.name).proxy_target.delete(klass.delete_all(construct_join_attributes(associate))) + klass.delete_all(construct_join_attributes(associate)) @target.delete(associate) end end diff --git a/activerecord/test/cases/associations/join_model_test.rb b/activerecord/test/cases/associations/join_model_test.rb index f59fe70654..e72c6d0e07 100644 --- a/activerecord/test/cases/associations/join_model_test.rb +++ b/activerecord/test/cases/associations/join_model_test.rb @@ -505,11 +505,13 @@ class AssociationsJoinModelTest < ActiveRecord::TestCase tag = Tag.create!(:name => 'doomed') post_thinking = posts(:thinking) post_thinking.tags << tag + assert_equal(count + 1, post_thinking.taggings(true).size) assert_equal(count + 1, post_thinking.tags(true).size) assert_nothing_raised { post_thinking.tags.delete(tag) } assert_equal(count, post_thinking.tags.size) assert_equal(count, post_thinking.tags(true).size) + assert_equal(count, post_thinking.taggings(true).size) assert_equal(tags_before.sort, post_thinking.tags.sort) end |