mirror of
https://github.com/discourse/discourse.git
synced 2025-05-31 03:08:23 +08:00
flagging work, we should be clearing from the mod menu if a topic or post is deleted
This commit is contained in:
@ -11,7 +11,9 @@ class Topic < ActiveRecord::Base
|
||||
|
||||
versioned :if => :new_version_required?
|
||||
acts_as_paranoid
|
||||
|
||||
after_recover :update_flagged_posts_count
|
||||
after_destroy :update_flagged_posts_count
|
||||
|
||||
rate_limit :default_rate_limiter
|
||||
rate_limit :limit_topics_per_day
|
||||
rate_limit :limit_private_messages_per_day
|
||||
@ -387,6 +389,10 @@ class Topic < ActiveRecord::Base
|
||||
topic
|
||||
end
|
||||
|
||||
def update_flagged_posts_count
|
||||
PostAction.update_flagged_posts_count
|
||||
end
|
||||
|
||||
|
||||
# Create the summary of the interesting posters in a topic. Cheats to avoid
|
||||
# many queries.
|
||||
|
Reference in New Issue
Block a user