mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FIX: update_counters wasn't properly updating topic counters
This commit is contained in:
@@ -331,7 +331,8 @@ class PostAction < ActiveRecord::Base
|
||||
end
|
||||
|
||||
topic_id = Post.with_deleted.where(id: post_id).pluck(:topic_id).first
|
||||
Topic.where(id: topic_id).update_all ["#{column} = ?", count]
|
||||
topic_count = Post.where(topic_id: topic_id).sum(column)
|
||||
Topic.where(id: topic_id).update_all ["#{column} = ?", topic_count]
|
||||
|
||||
if PostActionType.notify_flag_type_ids.include?(post_action_type_id)
|
||||
PostAction.update_flagged_posts_count
|
||||
|
||||
Reference in New Issue
Block a user