Module: CouchRest::Validation::ValidatesIsNumber

Included in:
ClassMethods
Defined in:
lib/couchrest/validation/validators/numeric_validator.rb

Overview

class NumericValidator

Instance Method Summary collapse

Instance Method Details

#validates_is_number(*fields) ⇒ Object



102
103
104
105
# File 'lib/couchrest/validation/validators/numeric_validator.rb', line 102

def validates_is_number(*fields)
  warn "[DEPRECATION] `validates_is_number` is deprecated.  Please use `validates_numericality_of` instead."
  validates_numericality_of(*fields)
end

#validates_numericality_of(*fields) ⇒ Object

Validate whether a field is numeric



97
98
99
100
# File 'lib/couchrest/validation/validators/numeric_validator.rb', line 97

def validates_numericality_of(*fields)
  opts = opts_from_validator_args(fields)
  add_validator_to_context(opts, fields, CouchRest::Validation::NumericValidator)
end