diff options
author | Xavier Noria <fxn@hashref.com> | 2012-08-01 20:16:59 +0200 |
---|---|---|
committer | Xavier Noria <fxn@hashref.com> | 2012-08-01 20:24:24 +0200 |
commit | f203be98645a603e03aa0dbbf2b7eb42cd729cb4 (patch) | |
tree | a5db94b472d0207885b53b100710aec1b5f6f8e4 /activerecord/lib/active_record | |
parent | 89177ba2000d6f587364d7ed8f8bf7ecd92e17cf (diff) | |
download | rails-f203be98645a603e03aa0dbbf2b7eb42cd729cb4.tar.gz rails-f203be98645a603e03aa0dbbf2b7eb42cd729cb4.tar.bz2 rails-f203be98645a603e03aa0dbbf2b7eb42cd729cb4.zip |
revises the deprecation warning of update_attribute
We have decided not to drop this important method in 4.0 and give
it a longer deprecation cycle. On the other hand we do not expect
to have update_column around for a long time, it is going to be
replaced in favor of update_columns.
Diffstat (limited to 'activerecord/lib/active_record')
-rw-r--r-- | activerecord/lib/active_record/persistence.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb index c9e3fc5b05..3926d6ee10 100644 --- a/activerecord/lib/active_record/persistence.rb +++ b/activerecord/lib/active_record/persistence.rb @@ -179,7 +179,7 @@ module ActiveRecord # def update_attribute(name, value) name = name.to_s - ActiveSupport::Deprecation.warn("update_attribute is deprecated and will be removed in Rails 4. If you want to skip mass-assignment protection, callbacks, and modifying updated_at, use update_column. If you do want those things, use update_attributes.") + ActiveSupport::Deprecation.warn("update_attribute is deprecated and will be removed in Rails 4.1. Please use update_attributes or update_columns instead. Check their documentation for the implications.") raise ActiveRecordError, "#{name} is marked as readonly" if self.class.readonly_attributes.include?(name) send("#{name}=", value) save(:validate => false) |