From ee669ab36fe93b8784416c408e84dee5c49d7427 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Sat, 31 Dec 2016 11:37:31 +1030 Subject: Prefer Regexp#match? over Regexp#=== --- activesupport/lib/active_support/inflector/inflections.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/inflector') diff --git a/activesupport/lib/active_support/inflector/inflections.rb b/activesupport/lib/active_support/inflector/inflections.rb index 5f877c328b..c47a2e34e1 100644 --- a/activesupport/lib/active_support/inflector/inflections.rb +++ b/activesupport/lib/active_support/inflector/inflections.rb @@ -1,5 +1,6 @@ require "concurrent/map" require "active_support/core_ext/array/prepend_and_append" +require "active_support/core_ext/regexp" require "active_support/i18n" module ActiveSupport @@ -50,7 +51,7 @@ module ActiveSupport end def uncountable?(str) - @regex_array.any? { |regex| regex === str } + @regex_array.any? { |regex| regex.match? str } end private -- cgit v1.2.3