Sha256: f701307f05f7318117cd7a4645d9ce8f8e4851d205addc3e578793fbb73e85c4
Contents?: true
Size: 422 Bytes
Versions: 1
Compression:
Stored size: 422 Bytes
Contents
require 'active_model' module PostcodeAnywhere module EmailValidation class Validator < ActiveModel::EachValidator def validate_each(record, attribute, value) if value.blank? record.errors.add(attribute, :blank, value: value) elsif !PostcodeAnywhere::EmailValidation.valid?(value) record.errors.add(attribute, :invalid, value: value) end end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
postcode_anywhere-email_validation-0.0.4 | lib/postcode_anywhere/email_validation/validator.rb |