Sha256: f23993947dca8c567621f31fcf46deba2b7ff269f1654f5a6817f07fddbc5ecc
Contents?: true
Size: 270 Bytes
Versions: 2
Compression:
Stored size: 270 Bytes
Contents
class PhoneValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /^[0-9+\(\)#\.\s\/ext-]+$/i record.errors[attribute] << (options[:message] || I18n.t('active_validation.errors.messages.phone')) end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
active_validation-1.1.0 | lib/active_validation/validators/phone_validator.rb |
active_validation-1.0.0 | lib/active_validation/validators/phone_validator.rb |