diff options
author | Matthew Draper <matthew@trebex.net> | 2016-12-31 11:33:10 +1030 |
---|---|---|
committer | Matthew Draper <matthew@trebex.net> | 2016-12-31 11:42:16 +1030 |
commit | afe057ebc2025d61ab89f7c0314a225764c49883 (patch) | |
tree | a8a43d71f99114cdd7c2bbad349b8b2fb8fbce6a /activesupport/lib/active_support/inflector | |
parent | ceb7cf6cdeca9a4eef15254fb3cac7c56ef2bd56 (diff) | |
download | rails-afe057ebc2025d61ab89f7c0314a225764c49883.tar.gz rails-afe057ebc2025d61ab89f7c0314a225764c49883.tar.bz2 rails-afe057ebc2025d61ab89f7c0314a225764c49883.zip |
Only add regexes for the new words
Diffstat (limited to 'activesupport/lib/active_support/inflector')
-rw-r--r-- | activesupport/lib/active_support/inflector/inflections.rb | 5 |
1 files changed, 3 insertions, 2 deletions
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 |