Add reviewed and unreviewed scopes to Reviewable model concern (#31988)

This commit is contained in:
Matt Jankowski 2024-09-20 04:51:37 -04:00 committed by GitHub
parent c922af2737
commit 04a939d640
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 33 additions and 23 deletions

View file

@ -3,6 +3,11 @@
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