aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-12-31 11:37:31 +1030
committerMatthew Draper <matthew@trebex.net>2016-12-31 11:42:16 +1030
commitee669ab36fe93b8784416c408e84dee5c49d7427 (patch)
tree5dc3fbecc3e92de590f7f24aec125992db75c583 /activesupport
parentafe057ebc2025d61ab89f7c0314a225764c49883 (diff)
downloadrails-ee669ab36fe93b8784416c408e84dee5c49d7427.tar.gz
rails-ee669ab36fe93b8784416c408e84dee5c49d7427.tar.bz2
rails-ee669ab36fe93b8784416c408e84dee5c49d7427.zip
Prefer Regexp#match? over Regexp#===
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/inflector/inflections.rb3
1 files changed, 2 insertions, 1 deletions
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