Class: MxWithFallbackValidator

Inherits:
ActiveModel::EachValidator
  • Object
show all
Defined in:
lib/valid_email/mx_with_fallback_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



4
5
6
7
8
9
# File 'lib/valid_email/mx_with_fallback_validator.rb', line 4

def validate_each(record,attribute,value)
  r = ValidateEmail.mx_valid_with_fallback?(value)
  record.errors.add attribute, (options[:message] || I18n.t(:invalid, :scope => "valid_email.validations.email")) unless r

  r
end