Sha256: bbd8b44a98eba1b0816e2a76970b8267c501462e9ba88aee9f85a99e12d17248

Contents?: true

Size: 241 Bytes

Versions: 4

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

4 entries across 4 versions & 1 rubygems

Version Path
kaze-0.4.0 stubs/default/app/validators/email_validator.rb
kaze-0.3.0 stubs/default/app/validators/email_validator.rb
kaze-0.2.0 stubs/default/app/validators/email_validator.rb
kaze-0.1.0 stubs/default/app/validators/email_validator.rb