From afe057ebc2025d61ab89f7c0314a225764c49883 Mon Sep 17 00:00:00 2001 From: Matthew Draper Date: Sat, 31 Dec 2016 11:33:10 +1030 Subject: Only add regexes for the new words --- activesupport/lib/active_support/inflector/inflections.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/inflector/inflections.rb b/activesupport/lib/active_support/inflector/inflections.rb index aa68f9ec9e..5f877c328b 100644 --- a/activesupport/lib/active_support/inflector/inflections.rb +++ b/activesupport/lib/active_support/inflector/inflections.rb @@ -43,8 +43,9 @@ module ActiveSupport end def add(words) - concat(words.flatten.map(&:downcase)) - @regex_array += map { |word| to_regex(word) } + words = words.flatten.map(&:downcase) + concat(words) + @regex_array += words.map { |word| to_regex(word) } self end -- cgit v1.2.3