module ActiveModel::Validations::HelperMethods

def validates_numericality_of(*attr_names)

end
validates_numericality_of :width, greater_than: :minimum_weight
validates_numericality_of :width, less_than: ->(person) { person.height }
class Person < ActiveRecord::Base

For example:

* :other_than
* :only_integer
* :less_than_or_equal_to
* :less_than
* :equal_to
* :greater_than_or_equal_to
* :greater_than

corresponds to a method:
The following checks can also be supplied with a proc or a symbol which

See ActiveModel::Validations::ClassMethods#validates for more information.
+:if+, +:unless+, +:on+, +:allow_nil+, +:allow_blank+, and +:strict+ .
There is also a list of default options supported by every validator:

error message for this option is _"must be in %{count}"_.
* :in - Check that the value is within a range. The default
default error message for this option is _"must be even"_.
* :even - Specifies the value must be an even number. The
error message for this option is _"must be odd"_.
* :odd - Specifies the value must be an odd number. The default
other than %{count}"_.
supplied value. The default error message for this option is _"must be
* :other_than - Specifies the value must be other than the
option is _"must be less than or equal to %{count}"_.
than or equal the supplied value. The default error message for this
* :less_than_or_equal_to - Specifies the value must be less
less than %{count}"_.
supplied value. The default error message for this option is _"must be
* :less_than - Specifies the value must be less than the
%{count}"_.
value. The default error message for this option is _"must be equal to
* :equal_to - Specifies the value must be equal to the supplied
for this option is _"must be greater than or equal to %{count}"_.
greater than or equal the supplied value. The default error message
* :greater_than_or_equal_to - Specifies the value must be
greater than %{count}"_.
supplied value. The default error message for this option is _"must be
* :greater_than - Specifies the value must be greater than the
converted to +nil+.
+false+). Notice that for Integer and Float columns empty strings are
* :allow_nil - Skip validation if attribute is +nil+ (default is
attempt parsing the value if it is a String.
instance of Numeric (default is +false+). The default behavior is to
* :only_numeric - Specifies whether the value has to be an
integer (default is +false+).
* :only_integer - Specifies whether the value has to be an
* :message - A custom error message (default is: "is not a number").
Configuration options:

end
validates_numericality_of :value, on: :create
class Person < ActiveRecord::Base

digits.
+true+). Precision of +Kernel.Float+ values are guaranteed up to 15
expression /\A[\+\-]?\d+\z/ (if only_integer is set to
only_integer is +false+) or applying it to the regular
trying to convert it to a float with +Kernel.Float+ (if
Validates whether the value of the specified attribute is numeric by
def validates_numericality_of(*attr_names)
  validates_with NumericalityValidator, _merge_attributes(attr_names)
end