mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-08 16:54:31 +00:00
27 lines
465 B
Ruby
27 lines
465 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Reviewable
|
|
extend ActiveSupport::Concern
|
|
|
|
included do
|
|
scope :reviewed, -> { where.not(reviewed_at: nil) }
|
|
scope :unreviewed, -> { where(reviewed_at: nil) }
|
|
end
|
|
|
|
def requires_review?
|
|
reviewed_at.nil?
|
|
end
|
|
|
|
def reviewed?
|
|
reviewed_at.present?
|
|
end
|
|
|
|
def requested_review?
|
|
requested_review_at.present?
|
|
end
|
|
|
|
def requires_review_notification?
|
|
requires_review? && !requested_review?
|
|
end
|
|
end
|