1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Pluralize counter_cache column name in example [ci skip]

This commit is contained in:
Amit Thawait 2016-01-20 11:51:42 +05:30
parent 56a9341689
commit e1e6d3438b

View file

@ -97,8 +97,8 @@ module ActiveRecord
#
# ==== Examples
#
# # Increment the post_count column for the record with an id of 5
# DiscussionBoard.increment_counter(:post_count, 5)
# # Increment the posts_count column for the record with an id of 5
# DiscussionBoard.increment_counter(:posts_count, 5)
def increment_counter(counter_name, id)
update_counters(id, counter_name => 1)
end
@ -115,8 +115,8 @@ module ActiveRecord
#
# ==== Examples
#
# # Decrement the post_count column for the record with an id of 5
# DiscussionBoard.decrement_counter(:post_count, 5)
# # Decrement the posts_count column for the record with an id of 5
# DiscussionBoard.decrement_counter(:posts_count, 5)
def decrement_counter(counter_name, id)
update_counters(id, counter_name => -1)
end