aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflector/inflections.rb
diff options
context:
space:
mode:
authorMatthew Draper <matthew@trebex.net>2016-12-31 11:33:10 +1030
committerMatthew Draper <matthew@trebex.net>2016-12-31 11:42:16 +1030
commitafe057ebc2025d61ab89f7c0314a225764c49883 (patch)
treea8a43d71f99114cdd7c2bbad349b8b2fb8fbce6a /activesupport/lib/active_support/inflector/inflections.rb
parentceb7cf6cdeca9a4eef15254fb3cac7c56ef2bd56 (diff)
downloadrails-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/inflections.rb')
-rw-r--r--activesupport/lib/active_support/inflector/inflections.rb5
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