From 01b0ccce32ffa9ed190072417a5da3e1f15322ed Mon Sep 17 00:00:00 2001 From: pavel Date: Wed, 12 Dec 2018 22:29:29 +0100 Subject: use match? --- activemodel/lib/active_model/validations/numericality.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'activemodel/lib') 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) -- cgit v1.2.3