Module: ActiveModel::Validations::HelperMethods

Defined in:
lib/email_check/helper_methods.rb

Instance Method Summary collapse

Instance Method Details

#validates_email(*attr_names) ⇒ Object

Validates email

Configuration options:

  • :check_mx - Check MX record for domain

  • :not_disposable - Check that this is not a disposable email

  • :not_free - Not a free email (ex. gmail.com, hotmail.com)

  • :not_blacklisted - If domain is on the blacklist, reject it

  • :block_special_usernames - If the username is one of the special usernames, reject it



12
13
14
# File 'lib/email_check/helper_methods.rb', line 12

def validates_email(*attr_names)
  validates_with EmailValidator, _merge_attributes(attr_names)
end

#validates_email_strictness(*attr_names) ⇒ Object

Turn everything on..



17
18
19
20
21
22
23
24
# File 'lib/email_check/helper_methods.rb', line 17

def validates_email_strictness(*attr_names)
  validates_with EmailValidator, _merge_attributes(attr_names).merge(
                                   :check_mx => true,
                                   :not_disposable => true,
                                   :not_free => true,
                                   :not_blacklisted => true,
                                   :block_special_usernames => true)
end