1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Remove :doc: for NumericalityValidator [ci skip]

The `:doc:` was added in cdb9d7f but `NumericalityValidator` is already
`:nodoc:` class. `:doc:` is unneeded.

https://github.com/rails/rails/blob/master/activemodel/lib/active_model/validations/numericality.rb#L3
This commit is contained in:
Ryuta Kamizono 2017-02-17 23:11:01 +09:00
parent 46bf9eea53
commit 33860b3556

View file

@ -63,27 +63,27 @@ module ActiveModel
private
def is_number?(raw_value) # :doc:
def is_number?(raw_value)
!parse_raw_value_as_a_number(raw_value).nil?
rescue ArgumentError, TypeError
false
end
def parse_raw_value_as_a_number(raw_value) # :doc:
def parse_raw_value_as_a_number(raw_value)
Kernel.Float(raw_value) if raw_value !~ /\A0[xX]/
end
def is_integer?(raw_value) # :doc:
def is_integer?(raw_value)
/\A[+-]?\d+\z/ === raw_value.to_s
end
def filtered_options(value) # :doc:
def filtered_options(value)
filtered = options.except(*RESERVED_OPTIONS)
filtered[:value] = value
filtered
end
def allow_only_integer?(record) # :doc:
def allow_only_integer?(record)
case options[:only_integer]
when Symbol
record.send(options[:only_integer])