Skip to content

Commit 9de0d59

Browse files
authored
Fix rdoc syntax for Kernel.Float (rails#46860)
1 parent e6f12f5 commit 9de0d59

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

activemodel/lib/active_model/validations/numericality.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,11 @@ def record_attribute_changed_in_place?(record, attr_name)
148148

149149
module HelperMethods
150150
# 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.
155156
#
156157
# class Person < ActiveRecord::Base
157158
# validates_numericality_of :value, on: :create

activerecord/lib/active_record/validations/numericality.rb

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,10 +21,11 @@ def column_scale_for(record, attribute)
2121

2222
module ClassMethods
2323
# 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.
2829
#
2930
# See ActiveModel::Validations::HelperMethods.validates_numericality_of for more information.
3031
def validates_numericality_of(*attr_names)

0 commit comments

Comments
 (0)