aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib/active_record/persistence.rb
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-15 11:28:22 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2012-08-15 11:58:41 -0300
commit8055cd65688d5aee9bf756c8483f2c30f75d06cc (patch)
treec7956934bb7672074e6a06c6f0611530ee5507df /activerecord/lib/active_record/persistence.rb
parent786713a3abc375fab4d5c2f6f62a878c2ab51022 (diff)
downloadrails-8055cd65688d5aee9bf756c8483f2c30f75d06cc.tar.gz
rails-8055cd65688d5aee9bf756c8483f2c30f75d06cc.tar.bz2
rails-8055cd65688d5aee9bf756c8483f2c30f75d06cc.zip
Do not use update_column where update_attribute is not interchangeable
Revert "Deprecate update_attribute." This reverts commit b081f6b59fb3f15d12043072ad9b331ffd2bc56e. Reason: Since the new deprecation policy we removed the deprecation of update_attribute but we didn't reverted the changes to use update_column. Fixes #7306
Diffstat (limited to 'activerecord/lib/active_record/persistence.rb')
-rw-r--r--activerecord/lib/active_record/persistence.rb9
1 files changed, 3 insertions, 6 deletions
diff --git a/activerecord/lib/active_record/persistence.rb b/activerecord/lib/active_record/persistence.rb
index d6249db380..038355deaa 100644
--- a/activerecord/lib/active_record/persistence.rb
+++ b/activerecord/lib/active_record/persistence.rb
@@ -174,9 +174,6 @@ module ActiveRecord
# * updated_at/updated_on column is updated if that column is available.
# * Updates all the attributes that are dirty in this object.
#
- # This method has been deprecated in favor of <tt>update_column</tt> due to
- # its similarity with <tt>update_attributes</tt>.
- #
def update_attribute(name, value)
name = name.to_s
raise ActiveRecordError, "#{name} is marked as readonly" if self.class.readonly_attributes.include?(name)
@@ -242,7 +239,7 @@ module ActiveRecord
# Saving is not subjected to validation checks. Returns +true+ if the
# record could be saved.
def increment!(attribute, by = 1)
- increment(attribute, by).update_column(attribute, self[attribute])
+ increment(attribute, by).update_attribute(attribute, self[attribute])
end
# Initializes +attribute+ to zero if +nil+ and subtracts the value passed as +by+ (default is 1).
@@ -259,7 +256,7 @@ module ActiveRecord
# Saving is not subjected to validation checks. Returns +true+ if the
# record could be saved.
def decrement!(attribute, by = 1)
- decrement(attribute, by).update_column(attribute, self[attribute])
+ decrement(attribute, by).update_attribute(attribute, self[attribute])
end
# Assigns to +attribute+ the boolean opposite of <tt>attribute?</tt>. So
@@ -276,7 +273,7 @@ module ActiveRecord
# Saving is not subjected to validation checks. Returns +true+ if the
# record could be saved.
def toggle!(attribute)
- toggle(attribute).update_column(attribute, self[attribute])
+ toggle(attribute).update_attribute(attribute, self[attribute])
end
# Reloads the attributes of this object from the database.