diff options
author | Steve Klabnik <steve@steveklabnik.com> | 2012-06-14 18:54:22 +0200 |
---|---|---|
committer | Steve Klabnik <steve@steveklabnik.com> | 2012-06-14 18:54:24 +0200 |
commit | a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01 (patch) | |
tree | 29534415b0675dcadbdd28f840aa90be079befed /activerecord/lib/active_record/associations | |
parent | 99c9d18601539c7e7e87f26bb047add1f93072af (diff) | |
download | rails-a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01.tar.gz rails-a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01.tar.bz2 rails-a7f4b0a1231bf3c65db2ad4066da78c3da5ffb01.zip |
Remove update_attribute.
Historically, update_attribute and update_attributes are similar, but
with one big difference: update_attribute does not run validations.
These two methods are really easy to confuse given their similar
names. Therefore, update_attribute is being removed in favor of
update_column.
See the thread on rails-core here:
https://groups.google.com/forum/?fromgroups#!topic/rubyonrails-core/BWPUTK7WvYA
Diffstat (limited to 'activerecord/lib/active_record/associations')
-rw-r--r-- | activerecord/lib/active_record/associations/has_one_association.rb | 2 |
1 files changed, 1 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 2131edbc20..f0d1120c68 100644 --- a/activerecord/lib/active_record/associations/has_one_association.rb +++ b/activerecord/lib/active_record/associations/has_one_association.rb @@ -36,7 +36,7 @@ module ActiveRecord when :destroy target.destroy when :nullify - target.update_attribute(reflection.foreign_key, nil) + target.update_column(reflection.foreign_key, nil) end end end |