diff options
Diffstat (limited to 'app/models/domain_block.rb')
-rw-r--r-- | app/models/domain_block.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/app/models/domain_block.rb b/app/models/domain_block.rb new file mode 100644 index 000000000..8f9eb1182 --- /dev/null +++ b/app/models/domain_block.rb @@ -0,0 +1,7 @@ +class DomainBlock < ApplicationRecord + validates :domain, presence: true, uniqueness: true + + def self.blocked?(domain) + where(domain: domain).exists? + end +end |