Sha256: a6a903b84f375c2a01c3620c3bce565efbec2e03f1fbb0fe2d30fa3eb0a52298
Contents?: true
Size: 255 Bytes
Versions: 5
Compression:
Stored size: 255 Bytes
Contents
class EmailValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i record.errors[attribute] << (options[:message] || 'is not an email') end end end
Version data entries
5 entries across 5 versions & 1 rubygems