Class: EmailFormatValidator

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

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



171
172
173
174
175
# File 'lib/validates_email_format_of.rb', line 171

def validate_each(record, attribute, value)
  err = ValidatesEmailFormatOf::validate_email_format(value, options)
  record.errors[attribute] << err unless err.nil?
  record.errors[attribute].flatten!
end