lib/active_support/inflector/methods.rb in activesupport-4.2.6 vs lib/active_support/inflector/methods.rb in activesupport-4.2.7.rc1

- old
+ new

@@ -151,10 +151,10 @@ # 'man from the boondocks'.titleize # => "Man From The Boondocks" # 'x-men: the last stand'.titleize # => "X Men: The Last Stand" # 'TheManWithoutAPast'.titleize # => "The Man Without A Past" # 'raiders_of_the_lost_ark'.titleize # => "Raiders Of The Lost Ark" def titleize(word) - humanize(underscore(word)).gsub(/\b(?<!['’`])[a-z]/) { $&.capitalize } + humanize(underscore(word)).gsub(/\b(?<!['’`])[a-z]/) { |match| match.capitalize } end # Create the name of a table like Rails does for models to table names. This # method uses the +pluralize+ method on the last word in the string. #