method

validates_numericality_of

Importance_1
v7.1.3.2 - Show latest stable - 0 notes - 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.

Show source
Register or log in to add new notes.