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



120
121
122
123
124
# File 'lib/validates_email_format_of.rb', line 120

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