Sha256: 8dd2817c9419df12ae66fd59111b1f39fe20981bdbe50af602216014fc751c7b
Contents?: true
Size: 264 Bytes
Versions: 8
Compression:
Stored size: 264 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] || I18n.t("errors.not_email")) end end end
Version data entries
8 entries across 8 versions & 1 rubygems