1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Replace with gsub! in ActiveSupport::Inflector.

This commit is contained in:
Elben Shira 2013-12-10 11:06:59 -06:00
parent bd360ad3c1
commit 88cff33a63

View file

@ -117,7 +117,8 @@ module ActiveSupport
result.gsub!(/([a-z\d]*)/i) { |match|
"#{inflections.acronyms[match] || match.downcase}"
}
options.fetch(:capitalize, true) ? result.gsub(/^\w/) { $&.upcase } : result
result.gsub!(/^\w/) { $&.upcase } if options.fetch(:capitalize, true)
result
end
# Capitalizes all the words and replaces some characters in the string to