Merge pull request #36896 from sharang-d/doc-fix

Standardize doc style for 'update_counters()' [ci skip]
This commit is contained in:
Rafael França 2019-08-08 18:51:39 -04:00 committed by GitHub
commit 9ddd936f7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -470,16 +470,16 @@ def update(id = :all, attributes) # :nodoc:
# Updates the counters of the records in the current relation.
#
# === Parameters
# ==== Parameters
#
# * +counter+ - A Hash containing the names of the fields to update as keys and the amount to update as values.
# * <tt>:touch</tt> option - Touch the timestamp columns when updating.
# * If attributes names are passed, they are updated along with update_at/on attributes.
#
# === Examples
# ==== Examples
#
# # For Posts by a given author increment the comment_count by 1.
# Post.where(author_id: author.id).update_counters(comment_count: 1)
# # For Posts by a given author increment the comment_count by 1.
# Post.where(author_id: author.id).update_counters(comment_count: 1)
def update_counters(counters)
touch = counters.delete(:touch)