Method: Validatable::Macros#validates_numericality_of

Defined in:
lib/validatable/macros.rb

#validates_numericality_of(*args) ⇒ Object

call-seq: validates_numericality_of(*args)

Validates that the specified attribute is numeric.

class Person
  include Validatable
  validates_numericality_of :age
end

Configuration options:

* after_validate - A block that executes following the run of a validation
* message - The message to add to the errors collection when the validation fails
* times - The number of times the validation applies
* level - The level at which the validation should occur
* if - A block that when executed must return true of the validation will not occur
* group - The group that this validation belongs to.  A validation can belong to multiple groups
* only_integer - Whether the attribute must be an integer (default is false)


96
97
98
# File 'lib/validatable/macros.rb', line 96

def validates_numericality_of(*args)
  add_validations(args, ValidatesNumericalityOf)
end