aboutsummaryrefslogtreecommitdiffstats
path: root/activemodel/lib
diff options
context:
space:
mode:
authorpavel <pavel.rosicky@easy.cz>2018-12-12 22:29:29 +0100
committerpavel <pavel.rosicky@easy.cz>2018-12-12 23:29:53 +0100
commit01b0ccce32ffa9ed190072417a5da3e1f15322ed (patch)
tree6c43c6eae2964faf46ddd79703e0e4bef4084d14 /activemodel/lib
parent3a3a3d607eb2f706c117926015d2cb6ef6599ded (diff)
downloadrails-01b0ccce32ffa9ed190072417a5da3e1f15322ed.tar.gz
rails-01b0ccce32ffa9ed190072417a5da3e1f15322ed.tar.bz2
rails-01b0ccce32ffa9ed190072417a5da3e1f15322ed.zip
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..7be20527e9 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)