diff options
author | Akira Matsuda <ronnie@dio.jp> | 2017-02-18 08:08:56 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-02-18 08:08:56 +0900 |
commit | 5abe7018f40712e047897fd9a566b3e5a6824904 (patch) | |
tree | b3bbb9f5a2cd11306bfbd4306c1914a3c146d322 /activemodel/lib/active_model/validations | |
parent | 46bf9eea533f8a2fedbb0aaad12cae1c5a4b9612 (diff) | |
parent | 33860b3556b0e922f16ebec1fc7b985bc4c23d17 (diff) | |
download | rails-5abe7018f40712e047897fd9a566b3e5a6824904.tar.gz rails-5abe7018f40712e047897fd9a566b3e5a6824904.tar.bz2 rails-5abe7018f40712e047897fd9a566b3e5a6824904.zip |
Merge pull request #28053 from kamipo/remove_doc
Remove `:doc:` for `NumericalityValidator` [ci skip]
Diffstat (limited to 'activemodel/lib/active_model/validations')
-rw-r--r-- | activemodel/lib/active_model/validations/numericality.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb index 4bfc402069..30a9ef472d 100644 --- a/activemodel/lib/active_model/validations/numericality.rb +++ b/activemodel/lib/active_model/validations/numericality.rb @@ -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]) |