More inflectoring #1490

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
上级 c196db95
*SVN*
* Added new rules to the Inflector to deal with more unusual plurals mouse/louse => mice/lice, information => information, ox => oxen, photo => photos #1571, #1583 [foamdino@gmail.com]
* Added new rules to the Inflector to deal with more unusual plurals mouse/louse => mice/lice, information => information, ox => oxen, photo => photos, archive => archives #1571, #1583, #1490 [foamdino@gmail.com/others]
* Fixed memory leak with Object#remove_subclasses_of, which inflicted a Rails application running in development mode with a ~20KB leak per request #1289 [c.r.mcgrath@gmail.com]
......
......@@ -65,6 +65,7 @@ def plural_rules #:doc:
[/(series)$/i, '\1\2'],
[/([^aeiouy]|qu)ies$/i, '\1y'],
[/([^aeiouy]|qu)y$/i, '\1ies'], # query, ability, agency
[/(hive)$/i, '\1s'], # archive, hive
[/(?:([^f])fe|([lr])f)$/i, '\1\2ves'], # half, safe, wife
[/sis$/i, 'ses'], # basis, diagnosis
[/([ti])um$/i, '\1a'], # datum, medium
......@@ -93,6 +94,7 @@ def singular_rules #:doc:
[/([^aeiouy]|qu)ies$/i, '\1y'],
[/([lr])ves$/i, '\1f'],
[/(tive)s$/i, '\1'],
[/(hive)s$/i, '\1'],
[/([^f])ves$/i, '\1fe'],
[/(^analy)ses$/i, '\1sis'],
[/((a)naly|(b)a|(d)iagno|(p)arenthe|(p)rogno|(s)ynop|(t)he)ses$/i, '\1\2sis'],
......
......@@ -27,6 +27,8 @@ class InflectorTest < Test::Unit::TestCase
"agency" => "agencies",
"movie" => "movies",
"archive" => "archives",
"wife" => "wives",
"safe" => "saves",
"half" => "halves",
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册