about summary refs log blame commit diff
path: root/app/models/domain_block.rb
blob: 3548ccd692063e8c29e63f1f36801fbf7285acfd (plain) (tree)
1
2
3
4
5
6
7
8
9
                             
                                     
                                     

                                                     
                                                     
     
# frozen_string_literal: true

class DomainBlock < ApplicationRecord
  enum severity: [:silence, :suspend]

  validates :domain, presence: true, uniqueness: true

  def self.blocked?(domain)
    where(domain: domain, severity: :suspend).exists?
  end
end