about summary refs log tree commit diff
path: root/app/models/domain_block.rb
blob: b4606da60dc87c1f8e5596359aaa212641a36dd4 (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).exists?
  end
end