aboutsummaryrefslogtreecommitdiffstats
path: root/activerecord/lib
diff options
context:
space:
mode:
authorPratik Naik <pratiknaik@gmail.com>2008-03-11 12:05:06 +0000
committerPratik Naik <pratiknaik@gmail.com>2008-03-11 12:05:06 +0000
commit8cc28daad61dca238e00c92221492dca82e69dc6 (patch)
treecc04eab4b7b1311d07fef4ac3f9f08b1cedca64f /activerecord/lib
parent3a17ea9031c32bf3b5817c74bba777ec06c5eb41 (diff)
downloadrails-8cc28daad61dca238e00c92221492dca82e69dc6.tar.gz
rails-8cc28daad61dca238e00c92221492dca82e69dc6.tar.bz2
rails-8cc28daad61dca238e00c92221492dca82e69dc6.zip
Add warning in documentation for increment!, decrement! and toggle! methods. Closes #11098 [DefV]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9011 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activerecord/lib')
-rwxr-xr-xactiverecord/lib/active_record/base.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb
index fbbd118640..d5da9408f3 100755
--- a/activerecord/lib/active_record/base.rb
+++ b/activerecord/lib/active_record/base.rb
@@ -2139,6 +2139,7 @@ module ActiveRecord #:nodoc:
end
# Increments the +attribute+ and saves the record.
+ # Note: Updates made with this method aren't subjected to validation checks
def increment!(attribute, by = 1)
increment(attribute, by).update_attribute(attribute, self[attribute])
end
@@ -2151,6 +2152,7 @@ module ActiveRecord #:nodoc:
end
# Decrements the +attribute+ and saves the record.
+ # Note: Updates made with this method aren't subjected to validation checks
def decrement!(attribute, by = 1)
decrement(attribute, by).update_attribute(attribute, self[attribute])
end
@@ -2162,6 +2164,7 @@ module ActiveRecord #:nodoc:
end
# Toggles the +attribute+ and saves the record.
+ # Note: Updates made with this method aren't subjected to validation checks
def toggle!(attribute)
toggle(attribute).update_attribute(attribute, self[attribute])
end