class ActiveModel::Validations::KickboxEmailFormatValidator
Constants
- DEFAULT_MESSAGE
Public Instance Methods
validate_each(record, attribute, value)
click to toggle source
# File lib/kickbox_email_format_validator.rb, line 10 def validate_each(record, attribute, value) if KickboxRails.invalid?(value) record.errors[attribute] << (defined?(I18n) ? I18n.t(:invalid_email_address, :default => (options[:message]||DEFAULT_MESSAGE), :locale => I18n.default_locale) : (options[:message]||DEFAULT_MESSAGE)) end end