Permalink
Browse files

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.
  • Loading branch information...
1 parent 89177ba commit f203be98645a603e03aa0dbbf2b7eb42cd729cb4 @fxn fxn committed Aug 1, 2012
Showing with 2 additions and 2 deletions.
  1. +1 −1 activerecord/CHANGELOG.md
  2. +1 −1 activerecord/lib/active_record/persistence.rb
@@ -11,7 +11,7 @@
*Rafael Mendonça França*
-* Change update_attribute deprecation warning suggesting to use update_columns instead of update_column. *Philip Arndt*
+* Change the deprecation warning of `update_attribute` suggesting to use `update_attributes` or `update_columns` instead of `update_column`. *Philip Arndt & Xavier Noria*
* update_columns added. *Sebastián Martínez*
@@ -179,7 +179,7 @@ def becomes(klass)
#
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)

0 comments on commit f203be9

Please sign in to comment.