diff options
author | Jo Liss <joliss42@gmail.com> | 2012-08-30 01:02:06 +0200 |
---|---|---|
committer | Jo Liss <joliss42@gmail.com> | 2012-08-30 01:02:06 +0200 |
commit | f4e7537f8614935e28422f6c6d5443b28287374c (patch) | |
tree | 12d72c11379bc19a6fd122d743315daf0bffc309 | |
parent | e94e8d8c3fcac624466afcf61f6a118abe5a6af4 (diff) | |
download | rails-f4e7537f8614935e28422f6c6d5443b28287374c.tar.gz rails-f4e7537f8614935e28422f6c6d5443b28287374c.tar.bz2 rails-f4e7537f8614935e28422f6c6d5443b28287374c.zip |
Revert "Grammar"
Per https://github.com/lifo/docrails/commit/e94e8d8c3fcac624466afcf61f6a118abe5a6af4#commitcomment-1784677
Thanks @randomecho!
This reverts commit e94e8d8c3fcac624466afcf61f6a118abe5a6af4.
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index 06bead41de..dd7da59a86 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -30,11 +30,11 @@ module ActiveRecord if (target || record) && target != record reflection.klass.transaction do remove_target!(options[:dependent]) if target && !target.destroyed? - + if record set_owner_attributes(record) set_inverse_instance(record) - + if owner.persisted? && save && !record.save nullify_owner_attributes(record) set_owner_attributes(target) if target @@ -82,7 +82,7 @@ module ActiveRecord if target.persisted? && owner.persisted? && !target.save set_owner_attributes(target) raise RecordNotSaved, "Failed to remove the existing associated #{reflection.name}. " + - "The record failed to save after its foreign key was set to nil." + "The record failed to save when after its foreign key was set to nil." end end end |