Skip to content

Commit

Permalink
Improvement in ActiveRecord::Persistence doc [ci skip]
Browse files Browse the repository at this point in the history
  • Loading branch information
sonalkr132 committed Oct 17, 2015
1 parent bae2292 commit 55cba0d
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions activerecord/lib/active_record/persistence.rb
Expand Up @@ -102,10 +102,10 @@ def persisted?

# Saves the model.
#
# If the model is new a record gets created in the database, otherwise
# If the model is new, a record gets created in the database, otherwise
# the existing record gets updated.
#
# By default, save always run validations. If any of them fail the action
# By default, save always runs validations. If any of them fail the action
# is cancelled and #save returns +false+. However, if you supply
# validate: false, validations are bypassed altogether. See
# ActiveRecord::Validations for more information.
Expand All @@ -132,9 +132,10 @@ def save(*args)
# If the model is new, a record gets created in the database, otherwise
# the existing record gets updated.
#
# With #save! validations always run. If any of them fail
# ActiveRecord::RecordInvalid gets raised. See ActiveRecord::Validations
# for more information.
# By default, #save! always runs validations. If any of them fail
# ActiveRecord::RecordInvalid gets raised. However, if you supply
# validate: false, validations are bypassed altogether. See
# ActiveRecord::Validations for more information.
#
# By default, #save! also sets the +updated_at+/+updated_on+ attributes to
# the current time. However, if you supply <tt>touch: false</tt>, these
Expand Down Expand Up @@ -246,7 +247,7 @@ def becomes!(klass)
# This method raises an ActiveRecord::ActiveRecordError if the
# attribute is marked as readonly.
#
# See also #update_column.
# Also see #update_column.
def update_attribute(name, value)
name = name.to_s
verify_readonly_attribute(name)
Expand Down Expand Up @@ -347,7 +348,7 @@ def decrement(attribute, by = 1)
end

# Wrapper around #decrement that saves the record. This method differs from
# its non-bang version in that it passes through the attribute setter.
# its non-bang version in the sense that it passes through the attribute setter.
# Saving is not subjected to validation checks. Returns +true+ if the
# record could be saved.
def decrement!(attribute, by = 1)
Expand All @@ -364,7 +365,7 @@ def toggle(attribute)
end

# Wrapper around #toggle that saves the record. This method differs from
# its non-bang version in that it passes through the attribute setter.
# its non-bang version in the sense that it passes through the attribute setter.
# Saving is not subjected to validation checks. Returns +true+ if the
# record could be saved.
def toggle!(attribute)
Expand Down

0 comments on commit 55cba0d

Please sign in to comment.