Class: Nondisposable::DisposableDomain

Inherits:
ApplicationRecord
  • Object
show all
Defined in:
app/models/nondisposable/disposable_domain.rb

Class Method Summary collapse

Class Method Details

.disposable?(domain) ⇒ Boolean

Returns:

  • (Boolean)


8
9
10
11
12
13
# File 'app/models/nondisposable/disposable_domain.rb', line 8

def disposable?(domain)
  return false if domain.blank?
  domain = domain.to_s.downcase
  Nondisposable.configuration.additional_domains.include?(domain) ||
    (where(name: domain).exists? && !Nondisposable.configuration.excluded_domains.include?(domain))
end