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