diff options
author | Vijay Dev <vijaydev.cse@gmail.com> | 2011-03-29 00:41:11 +0530 |
---|---|---|
committer | Vijay Dev <vijaydev.cse@gmail.com> | 2011-03-29 00:41:11 +0530 |
commit | 910a8d22460a8b8e67a16441dadb87cc12ab7a4a (patch) | |
tree | a0561863efa0e49b6f1982b6a39182e7750c5083 /activerecord/lib/active_record/associations/has_one_association.rb | |
parent | 7b9bdd9253c7f8f3b89664ac616ff9bd5ea3ac87 (diff) | |
parent | 62dd3458e326b1f2927d43401e7b10004410fdf0 (diff) | |
download | rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.tar.gz rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.tar.bz2 rails-910a8d22460a8b8e67a16441dadb87cc12ab7a4a.zip |
Merge branch 'master' of github.com:lifo/docrails
Diffstat (limited to 'activerecord/lib/active_record/associations/has_one_association.rb')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/associations/has_one_association.rb b/activerecord/lib/active_record/associations/has_one_association.rb index 1d2e8667e4..dfcb116392 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -34,7 +34,8 @@ module ActiveRecord when :destroy target.destroy when :nullify - target.update_attribute(reflection.foreign_key, nil) + target.send("#{reflection.foreign_key}=", nil) + target.save(:validations => false) end end end |