mirror of
https://github.com/discourse/discourse.git
synced 2025-02-22 20:45:51 +00:00
FIX: update user vote count on topic trash/recover (#8144)
This commit is contained in:
parent
fa1ed9799c
commit
1e2aa263a9
@ -33,6 +33,7 @@ class Topic < ActiveRecord::Base
|
||||
if deleted_at.nil?
|
||||
update_category_topic_count_by(-1)
|
||||
CategoryTagStat.topic_deleted(self) if self.tags.present?
|
||||
DiscourseEvent.trigger(:topic_trashed, self)
|
||||
end
|
||||
super(trashed_by)
|
||||
self.topic_embed.trash! if has_topic_embed?
|
||||
@ -42,6 +43,7 @@ class Topic < ActiveRecord::Base
|
||||
unless deleted_at.nil?
|
||||
update_category_topic_count_by(1)
|
||||
CategoryTagStat.topic_recovered(self) if self.tags.present?
|
||||
DiscourseEvent.trigger(:topic_recovered, self)
|
||||
end
|
||||
|
||||
# Note parens are required because superclass doesn't take `recovered_by`
|
||||
|
Loading…
x
Reference in New Issue
Block a user