Class: ActiveModel::Validations::SsnValidator

Inherits:
EachValidator
  • Object
show all
Defined in:
lib/active_validators/active_model/validations/ssn_validator.rb

Instance Method Summary collapse

Instance Method Details

#validate_each(record, attribute, value) ⇒ Object



4
5
6
# File 'lib/active_validators/active_model/validations/ssn_validator.rb', line 4

def validate_each(record, attribute, value)
  record.errors.add(attribute) if value.blank? || !SsnValidatorGeneral.valid?(options, value)
end