Sha256: bf269ad3ac6a1932a1ba72f5d2397743f2459c043af12e435f23355f94c075a8
Contents?: true
Size: 281 Bytes
Versions: 11
Compression:
Stored size: 281 Bytes
Contents
class SsnValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless value =~ /^\A([\d]{3}\-[\d]{2}\-[\d]{4}|[\d]{9})\Z$/ record.errors[attribute] << (options[:message] || I18n.t('flash_validators.errors.messages.ssn')) end end end
Version data entries
11 entries across 11 versions & 1 rubygems