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

Validate whether a field is numeric



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

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