Sha256: 44b44e2592ca760742c5ad5dcd5be7773fd36dfebb98caaa418a706893b4155e
Contents?: true
Size: 242 Bytes
Versions: 10
Compression:
Stored size: 242 Bytes
Contents
module Proposal class EmailValidator < ActiveModel::Validator def validate record unless record.email =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i record.errors.add :email, "is not valid" end end end end
Version data entries
10 entries across 10 versions & 1 rubygems