Skip to content
This repository
Browse code

Add warning in documentation for increment!, decrement! and toggle! m…

…ethods. Closes #11098 [DefV]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@9011 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 8cc28daad61dca238e00c92221492dca82e69dc6 1 parent 3a17ea9
Pratik authored March 11, 2008

Showing 1 changed file with 3 additions and 0 deletions. Show diff stats Hide diff stats

  1. 3  activerecord/lib/active_record/base.rb
3  activerecord/lib/active_record/base.rb
@@ -2139,6 +2139,7 @@ def increment(attribute, by = 1)
2139 2139
       end
2140 2140
 
2141 2141
       # Increments the +attribute+ and saves the record.
  2142
+      # Note: Updates made with this method aren't subjected to validation checks
2142 2143
       def increment!(attribute, by = 1)
2143 2144
         increment(attribute, by).update_attribute(attribute, self[attribute])
2144 2145
       end
@@ -2151,6 +2152,7 @@ def decrement(attribute, by = 1)
2151 2152
       end
2152 2153
 
2153 2154
       # Decrements the +attribute+ and saves the record.
  2155
+      # Note: Updates made with this method aren't subjected to validation checks
2154 2156
       def decrement!(attribute, by = 1)
2155 2157
         decrement(attribute, by).update_attribute(attribute, self[attribute])
2156 2158
       end
@@ -2162,6 +2164,7 @@ def toggle(attribute)
2162 2164
       end
2163 2165
 
2164 2166
       # Toggles the +attribute+ and saves the record.
  2167
+      # Note: Updates made with this method aren't subjected to validation checks
2165 2168
       def toggle!(attribute)
2166 2169
         toggle(attribute).update_attribute(attribute, self[attribute])
2167 2170
       end

0 notes on commit 8cc28da

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