File tree Expand file tree Collapse file tree 2 files changed +10
-8
lines changed
activemodel/lib/active_model/validations
activerecord/lib/active_record/validations Expand file tree Collapse file tree 2 files changed +10
-8
lines changed Original file line number Diff line number Diff line change @@ -148,10 +148,11 @@ def record_attribute_changed_in_place?(record, attr_name)
148
148
149
149
module HelperMethods
150
150
# Validates whether the value of the specified attribute is numeric by
151
- # trying to convert it to a float with Kernel.Float (if <tt>only_integer</tt>
152
- # is +false+) or applying it to the regular expression <tt>/\A[\+\-]?\d+\z/</tt>
153
- # (if <tt>only_integer</tt> is set to +true+). Precision of Kernel.Float values
154
- # are guaranteed up to 15 digits.
151
+ # trying to convert it to a float with +Kernel.Float+ (if
152
+ # <tt>only_integer</tt> is +false+) or applying it to the regular
153
+ # expression <tt>/\A[\+\-]?\d+\z/</tt> (if <tt>only_integer</tt> is set to
154
+ # +true+). Precision of +Kernel.Float+ values are guaranteed up to 15
155
+ # digits.
155
156
#
156
157
# class Person < ActiveRecord::Base
157
158
# validates_numericality_of :value, on: :create
Original file line number Diff line number Diff line change @@ -21,10 +21,11 @@ def column_scale_for(record, attribute)
21
21
22
22
module ClassMethods
23
23
# Validates whether the value of the specified attribute is numeric by
24
- # trying to convert it to a float with Kernel.Float (if <tt>only_integer</tt>
25
- # is +false+) or applying it to the regular expression <tt>/\A[\+\-]?\d+\z/</tt>
26
- # (if <tt>only_integer</tt> is set to +true+). Kernel.Float precision
27
- # defaults to the column's precision value or 15.
24
+ # trying to convert it to a float with +Kernel.Float+ (if
25
+ # <tt>only_integer</tt> is +false+) or applying it to the regular
26
+ # expression <tt>/\A[\+\-]?\d+\z/</tt> (if <tt>only_integer</tt> is set to
27
+ # +true+). +Kernel.Float+ precision defaults to the column's precision
28
+ # value or 15.
28
29
#
29
30
# See ActiveModel::Validations::HelperMethods.validates_numericality_of for more information.
30
31
def validates_numericality_of ( *attr_names )
You can’t perform that action at this time.
0 commit comments