method

validates_numericality_of

rails latest stable - Class: ActiveRecord::Validations::ClassMethods
validates_numericality_of(*attr_names)
public

Validates whether the value of the specified attribute is numeric by trying to convert it to a float with Kernel.Float (if only_integer is false) or applying it to the regular expression /\A[+\-]?\d+\z/ (if only_integer is set to true). Kernel.Float precision defaults to the column’s precision value or 15.

See ActiveModel::Validations::HelperMethods.validates_numericality_of for more information.