mirror of
https://github.com/discourse/discourse.git
synced 2026-08-09 12:38:21 -05:00
Record when a post was hidden
This commit is contained in:
@@ -307,7 +307,7 @@ class PostAction < ActiveRecord::Base
|
||||
reason = guess_hide_reason(old_flags)
|
||||
end
|
||||
|
||||
Post.where(id: post.id).update_all(["hidden = true, hidden_reason_id = COALESCE(hidden_reason_id, ?)", reason])
|
||||
Post.where(id: post.id).update_all(["hidden = true, hidden_at = CURRENT_TIMESTAMP, hidden_reason_id = COALESCE(hidden_reason_id, ?)", reason])
|
||||
Topic.where(["id = :topic_id AND NOT EXISTS(SELECT 1 FROM POSTS WHERE topic_id = :topic_id AND NOT hidden)",
|
||||
topic_id: post.topic_id]).update_all({ visible: false })
|
||||
|
||||
|
||||
Reference in New Issue
Block a user