mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Added .only_deleted scope in the Trashable module (#20196)
This commit is contained in:
@@ -6,6 +6,7 @@ module Trashable
|
||||
included do
|
||||
default_scope { where(deleted_at: nil) }
|
||||
scope :with_deleted, -> { unscope(where: :deleted_at) }
|
||||
scope :only_deleted, -> { with_deleted.where.not(deleted_at: nil) }
|
||||
|
||||
belongs_to :deleted_by, class_name: "User"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user