Sha256: cad4a80a67e8a5df82194d97b95dd5977595a97399b2170822dc39338a083116
Contents?: true
Size: 380 Bytes
Versions: 13
Compression:
Stored size: 380 Bytes
Contents
class SsnValidator < ActiveModel::EachValidator def validate_each(record, attribute, value) unless valid_ssn?(record, attribute, value) record.errors[attribute] << "#{value} is not a valid Social Security Number" end end def self.kind() :custom end def valid_ssn?(record, attribute, value) # irrelevant here how validation is done true end end
Version data entries
13 entries across 13 versions & 4 rubygems