Module: DataMapper::Validate::ValidatesIsNumber

Included in:
ClassMethods
Defined in:
lib/gems/dm-validations-0.9.9/lib/dm-validations/numeric_validator.rb

Overview

class NumericValidator

Instance Method Summary collapse

Instance Method Details

#validates_is_number(*fields) ⇒ Object

Validate whether a field is numeric



76
77
78
79
# File 'lib/gems/dm-validations-0.9.9/lib/dm-validations/numeric_validator.rb', line 76

def validates_is_number(*fields)
  opts = opts_from_validator_args(fields)
  add_validator_to_context(opts, fields, DataMapper::Validate::NumericValidator)
end