mirror of
https://github.com/discourse/discourse.git
synced 2025-06-01 09:08:10 +08:00
FEATURE: Add "Reset Bump Date" action to topic admin wrench (#6246)
This commit is contained in:
@ -1381,6 +1381,16 @@ class Topic < ActiveRecord::Base
|
||||
@is_category_topic ||= Category.exists?(topic_id: self.id.to_i)
|
||||
end
|
||||
|
||||
def reset_bumped_at
|
||||
post = ordered_posts.where(
|
||||
user_deleted: false,
|
||||
hidden: false,
|
||||
post_type: Topic.visible_post_types
|
||||
).last
|
||||
|
||||
update!(bumped_at: post.created_at)
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def update_category_topic_count_by(num)
|
||||
|
Reference in New Issue
Block a user