Sha256: 0f7ab721d1f0e379d69092eb6f0206e2f98e8c596971592df4c5bbec7a164d0b
Contents?: true
Size: 291 Bytes
Versions: 10
Compression:
Stored size: 291 Bytes
Contents
class EmailFormatValidator < ActiveModel::EachValidator def validate_each(object, attribute, value) unless value =~ /\A[^`@\s]+@([^@`\s\.]+\.)+[^`@\s\.]+\z/ object.errors[attribute] << (options[:message] || "enter a valid email address (e.g. name@example.com)") end end end
Version data entries
10 entries across 10 versions & 1 rubygems