mirror of
https://github.com/github/rails.git
synced 2026-01-29 08:18:03 -05:00
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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user