Permalink
Browse files

Replace with gsub! in ActiveSupport::Inflector.

  • Loading branch information...
1 parent bd360ad commit 88cff33a63699d08220411b0090f2f0e40c15cf3 @elben elben committed Dec 10, 2013
Showing with 2 additions and 1 deletion.
  1. +2 −1 activesupport/lib/active_support/inflector/methods.rb
@@ -117,7 +117,8 @@ def humanize(lower_case_and_underscored_word, options = {})
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

0 comments on commit 88cff33

Please sign in to comment.