Revert "Merge pull request #12443 from arthurnn/add_inverse_of_add_target"

This reverts commit 7ed5bdc834, reversing
changes made to 31c79e291f.

Reason: this caused a regression when the associated record is creted in
a before_create callback.

See https://github.com/rails/rails/pull/12413#issuecomment-25848163
This commit is contained in:
Rafael Mendonça França
2013-10-10 14:40:24 -03:00
parent 5ede19b772
commit fbc69ac560
2 changed files with 0 additions and 14 deletions

View File

@@ -350,7 +350,6 @@ module ActiveRecord
end
callback(:after_add, record)
set_inverse_instance(record)
record
end

View File

@@ -290,19 +290,6 @@ class InverseHasManyTests < ActiveRecord::TestCase
def test_trying_to_use_inverses_that_dont_exist_should_raise_an_error
assert_raise(ActiveRecord::InverseOfAssociationNotFoundError) { Man.find(:first).secret_interests }
end
def test_child_instance_should_point_to_parent_without_saving
man = Man.new
i = Interest.create(:topic => 'Industrial Revolution Re-enactment')
man.interests << i
assert_not_nil i.man
i.man.name = "Charles"
assert_equal i.man.name, man.name
assert !man.persisted?
end
end
class InverseBelongsToTests < ActiveRecord::TestCase