Skip to content
Browse files

Suggest using update_columns instead of update_column.

update_column is deprecated in Rails 4.0 so it makes no sense to
recommend adopting it only to require changing to update_columns
in the very next release.
  • Loading branch information...
1 parent f27a8eb commit a0b85b9ada9c5afbe891f290e9f2effbcb79aeab @parndt committed Jul 26, 2012
Showing with 1 addition and 1 deletion.
  1. +1 −1 activerecord/lib/active_record/persistence.rb
View
2 activerecord/lib/active_record/persistence.rb
@@ -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. If you want to skip mass-assignment protection, callbacks, and modifying updated_at, use update_columns. If you do want those things, use update_attributes.")
raise ActiveRecordError, "#{name} is marked as readonly" if self.class.readonly_attributes.include?(name)
send("#{name}=", value)
save(:validate => false)

0 comments on commit a0b85b9

Please sign in to comment.
Something went wrong with that request. Please try again.