Class: ActiveModel::Validations::SsnValidatorGeneral

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

Overview

DEPRECATED: Please use :ssn => true instead.

Class Method Summary collapse

Class Method Details

.valid?(options, value) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
14
15
16
17
# File 'lib/active_validators/active_model/validations/ssn_validator.rb', line 11

def self.valid?(options, value)
  if options[:type] == :usa_ssn
    ActiveSupport::Deprecation.warn "providing {:type => :usa_ssn} is deprecated and will be removed in the future. Please use `:ssn => true` instead."
  end

  SsnValidatorUSA.new(value).valid?
end