mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add deleted_by to Trashable tables
This commit is contained in:
@@ -37,12 +37,14 @@ class PostDestroyer
|
||||
# Feature users in the topic
|
||||
Jobs.enqueue(:feature_topic_users, topic_id: @post.topic_id, except_post_id: @post.id)
|
||||
|
||||
@post.post_actions.map(&:trash!)
|
||||
@post.post_actions.each do |pa|
|
||||
pa.trash!(@user)
|
||||
end
|
||||
|
||||
f = PostActionType.types.map{|k,v| ["#{k}_count", 0]}
|
||||
Post.with_deleted.where(id: @post.id).update_all(Hash[*f.flatten])
|
||||
|
||||
@post.trash!
|
||||
@post.trash!(@user)
|
||||
|
||||
Topic.reset_highest(@post.topic_id)
|
||||
|
||||
@@ -59,7 +61,7 @@ class PostDestroyer
|
||||
# Remove any notifications that point to this deleted post
|
||||
Notification.delete_all topic_id: @post.topic_id, post_number: @post.post_number
|
||||
|
||||
@post.topic.trash! if @post.post_number == 1
|
||||
@post.topic.trash!(@user) if @post.post_number == 1
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user