aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorRyuta Kamizono <kamipo@gmail.com>2018-12-13 13:19:27 +0900
committerRyuta Kamizono <kamipo@gmail.com>2018-12-13 13:20:14 +0900
commit144b57d925af8ea6b5bdde549eb11f1579222600 (patch)
treea647adf48d71cd6c06bfacbc15449c7e6705fde8 /activemodel/lib
parent2c325182b84ea4c75855c777b25de0f15fd218e5 (diff)
parent01b0ccce32ffa9ed190072417a5da3e1f15322ed (diff)
downloadrails-144b57d925af8ea6b5bdde549eb11f1579222600.tar.gz
rails-144b57d925af8ea6b5bdde549eb11f1579222600.tar.bz2
rails-144b57d925af8ea6b5bdde549eb11f1579222600.zip
Merge pull request #34693 from ahorek/match
[perf] use #match?
Diffstat (limited to 'activemodel/lib')
-rw-r--r--activemodel/lib/active_model/validations/numericality.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/activemodel/lib/active_model/validations/numericality.rb b/activemodel/lib/active_model/validations/numericality.rb
index 1cafb15ac7..c5997283ea 100644
--- a/activemodel/lib/active_model/validations/numericality.rb
+++ b/activemodel/lib/active_model/validations/numericality.rb
@@ -98,15 +98,15 @@ module ActiveModel
end
def is_integer?(raw_value)
- INTEGER_REGEX === raw_value.to_s
+ INTEGER_REGEX.match?(raw_value.to_s)
end
def is_decimal?(raw_value)
- DECIMAL_REGEX === raw_value.to_s
+ DECIMAL_REGEX.match?(raw_value.to_s)
end
def is_hexadecimal_literal?(raw_value)
- /\A0[xX]/ === raw_value
+ /\A0[xX]/.match?(raw_value)
end
def filtered_options(value)