From 8cc28daad61dca238e00c92221492dca82e69dc6 Mon Sep 17 00:00:00 2001 From: Pratik Naik Date: Tue, 11 Mar 2008 12:05:06 +0000 Subject: 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 --- activerecord/lib/active_record/base.rb | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3