mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Fixed String#titleize to work for strings with 's too (closes #10571) [trek]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8533 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
*SVN*
|
||||
|
||||
* Fixed String#titleize to work for strings with 's too #10571 [trek]
|
||||
|
||||
* Changed the implementation of Enumerable#group_by to use a double array approach instead of a hash such that the insert order is honored [DHH/Marcel]
|
||||
|
||||
* remove multiple enumerations from ActiveSupport::JSON#convert_json_to_yaml when dealing with date/time values. [rick]
|
||||
|
||||
@@ -162,7 +162,7 @@ module Inflector
|
||||
# "man from the boondocks".titleize #=> "Man From The Boondocks"
|
||||
# "x-men: the last stand".titleize #=> "X Men: The Last Stand"
|
||||
def titleize(word)
|
||||
humanize(underscore(word)).gsub(/\b([a-z])/) { $1.capitalize }
|
||||
humanize(underscore(word)).gsub(/\b('?[a-z])/) { $1.capitalize }
|
||||
end
|
||||
|
||||
# The reverse of +camelize+. Makes an underscored form from the expression in the string.
|
||||
|
||||
@@ -155,7 +155,10 @@ module InflectorTestCases
|
||||
'Action Web Service' => 'Action Web Service',
|
||||
'Action web service' => 'Action Web Service',
|
||||
'actionwebservice' => 'Actionwebservice',
|
||||
'Actionwebservice' => 'Actionwebservice'
|
||||
'Actionwebservice' => 'Actionwebservice',
|
||||
"david's code" => "David's Code",
|
||||
"David's code" => "David's Code",
|
||||
"david's Code" => "David's Code"
|
||||
}
|
||||
|
||||
OrdinalNumbers = {
|
||||
|
||||
Reference in New Issue
Block a user