about summary refs log tree commit diff
path: root/app/models/domain_block.rb
blob: 3548ccd692063e8c29e63f1f36801fbf7285acfd (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
# 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