@@ -87,28 +87,28 @@ def reset_counters(id, *counters, touch: nil)
87
87
#
88
88
# ==== Examples
89
89
#
90
- # # For the Post with id of 5, decrement the comment_count by 1, and
91
- # # increment the action_count by 1
92
- # Post.update_counters 5, comment_count : -1, action_count : 1
90
+ # # For the Post with id of 5, decrement the comments_count by 1, and
91
+ # # increment the actions_count by 1
92
+ # Post.update_counters 5, comments_count : -1, actions_count : 1
93
93
# # Executes the following SQL:
94
94
# # UPDATE posts
95
- # # SET comment_count = COALESCE(comment_count , 0) - 1,
96
- # # action_count = COALESCE(action_count , 0) + 1
95
+ # # SET comments_count = COALESCE(comments_count , 0) - 1,
96
+ # # actions_count = COALESCE(actions_count , 0) + 1
97
97
# # WHERE id = 5
98
98
#
99
- # # For the Posts with id of 10 and 15, increment the comment_count by 1
100
- # Post.update_counters [10, 15], comment_count : 1
99
+ # # For the Posts with id of 10 and 15, increment the comments_count by 1
100
+ # Post.update_counters [10, 15], comments_count : 1
101
101
# # Executes the following SQL:
102
102
# # UPDATE posts
103
- # # SET comment_count = COALESCE(comment_count , 0) + 1
103
+ # # SET comments_count = COALESCE(comments_count , 0) + 1
104
104
# # WHERE id IN (10, 15)
105
105
#
106
- # # For the Posts with id of 10 and 15, increment the comment_count by 1
106
+ # # For the Posts with id of 10 and 15, increment the comments_count by 1
107
107
# # and update the updated_at value for each counter.
108
- # Post.update_counters [10, 15], comment_count : 1, touch: true
108
+ # Post.update_counters [10, 15], comments_count : 1, touch: true
109
109
# # Executes the following SQL:
110
110
# # UPDATE posts
111
- # # SET comment_count = COALESCE(comment_count , 0) + 1,
111
+ # # SET comments_count = COALESCE(comments_count , 0) + 1,
112
112
# # `updated_at` = '2016-10-13T09:59:23-05:00'
113
113
# # WHERE id IN (10, 15)
114
114
def update_counters ( id , counters )
0 commit comments