Sha256: 6620c905d0855e7008296c81836203e98448693166a2af11a33f2a15f0b747c3

Contents?: true

Size: 241 Bytes

Versions: 13

Compression:

Stored size: 241 Bytes

Contents

class EmailValidator < ActiveModel::EachValidator
  def validate_each(record, attribute, value)
    unless URI::MailTo::EMAIL_REGEXP.match?(value)
      record.errors.add attribute, (options[:message] || 'is not an email')
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
kaze-0.17.0 stubs/default/app/validators/email_validator.rb
kaze-0.16.0 stubs/default/app/validators/email_validator.rb
kaze-0.15.0 stubs/default/app/validators/email_validator.rb
kaze-0.14.0 stubs/default/app/validators/email_validator.rb
kaze-0.13.0 stubs/default/app/validators/email_validator.rb
kaze-0.12.0 stubs/default/app/validators/email_validator.rb
kaze-0.11.0 stubs/default/app/validators/email_validator.rb
kaze-0.10.0 stubs/default/app/validators/email_validator.rb
kaze-0.9.0 stubs/default/app/validators/email_validator.rb
kaze-0.8.0 stubs/default/app/validators/email_validator.rb
kaze-0.7.0 stubs/default/app/validators/email_validator.rb
kaze-0.6.0 stubs/default/app/validators/email_validator.rb
kaze-0.5.0 stubs/default/app/validators/email_validator.rb