Skip to content

Commit

Permalink
Merge pull request #36896 from sharang-d/doc-fix
Browse files Browse the repository at this point in the history
Standardize doc style for 'update_counters()' [ci skip]
  • Loading branch information
rafaelfranca committed Aug 8, 2019
2 parents 6ebdab3 + fb654c1 commit 9ddd936
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions activerecord/lib/active_record/relation.rb
Expand Up @@ -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)

Expand Down

0 comments on commit 9ddd936

Please sign in to comment.