Add reviewed and unreviewed scopes to Reviewable model concern (#31988)
				
					
				
			This commit is contained in:
		@@ -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
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user