mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Fix a case when a staff user views a topic with a deleted post by a nuked user; might be a temporary solution until we decide what to do with nuked records
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Use the AdminLogger class to log records to this table.
|
||||
class AdminLog < ActiveRecord::Base
|
||||
belongs_to :admin, class_name: 'User'
|
||||
belongs_to :target_user, class_name: 'User' # can be nil
|
||||
belongs_to :target_user, class_name: 'User' # can be nil, or return nil if user record was nuked
|
||||
|
||||
validates_presence_of :admin_id
|
||||
validates_presence_of :action
|
||||
|
||||
@@ -45,6 +45,7 @@ class Post < ActiveRecord::Base
|
||||
scope :public_posts, -> { joins(:topic).where('topics.archetype <> ?', Archetype.private_message) }
|
||||
scope :private_posts, -> { joins(:topic).where('topics.archetype = ?', Archetype.private_message) }
|
||||
scope :with_topic_subtype, ->(subtype) { joins(:topic).where('topics.subtype = ?', subtype) }
|
||||
scope :without_nuked_users, -> { where(nuked_user: false) }
|
||||
|
||||
def self.hidden_reasons
|
||||
@hidden_reasons ||= Enum.new(:flag_threshold_reached, :flag_threshold_reached_again, :new_user_spam_threshold_reached)
|
||||
|
||||
Reference in New Issue
Block a user