Sha256: bc074f894a6455c87da720afc14f049ed6835f8436a3b4092e191ebad7867cce
Contents?: true
Size: 246 Bytes
Versions: 9
Compression:
Stored size: 246 Bytes
Contents
class EmailValidator < ActiveModel::EachValidator def validate_each(record,attribute,value) unless value =~ /\A[^@\s]+@([^@\s]+\.)+[^@\s]+\z/ record.errors.add(attribute, :invalid, {:value => value}.merge!(options)) end end end
Version data entries
9 entries across 9 versions & 1 rubygems