* Skip moderation notification if the user is the moderator * Update spec/workers/notifications/moderation_notification_worker_spec.rb Co-Authored-By: Vaidehi Joshi <vaidehi.sj@gmail.com> Co-authored-by: Vaidehi Joshi <vaidehi.sj@gmail.com>
12 lines
340 B
Ruby
12 lines
340 B
Ruby
module Notifications
|
|
module Moderation
|
|
MODERATORS_AVAILABILITY_DELAY = 22.hours
|
|
SUPPORTED = [Comment].freeze
|
|
|
|
def self.available_moderators
|
|
User.with_role(:trusted).
|
|
where("last_moderation_notification < ?", MODERATORS_AVAILABILITY_DELAY.ago).
|
|
where(mod_roundrobin_notifications: true)
|
|
end
|
|
end
|
|
end
|