Fixed photo/photos #1583

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1615 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
This commit is contained in:
David Heinemeier Hansson 2005-07-02 18:59:01 +00:00
parent b7f37d3ef9
commit c196db9527
3 changed files with 13 additions and 10 deletions

@ -1,6 +1,6 @@
*SVN*
* Added new rules to the Inflector to deal with more unusual plurals mouse/louse => mice/lice, information => information, ox => oxen #1571 [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 #1571, #1583 [foamdino@gmail.com]
* 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]

@ -71,6 +71,7 @@ def plural_rules #:doc:
[/(p)erson$/i, '\1\2eople'], # person, salesperson
[/(m)an$/i, '\1\2en'], # man, woman, spokesman
[/(c)hild$/i, '\1\2hildren'], # child
[/(photo)$/i, '\1s'],
[/(o)$/i, '\1\2es'], # buffalo, tomato
[/(bu)s$/i, '\1\2ses'], # bus
[/s$/i, 's'], # no change (compatibility)
@ -82,6 +83,7 @@ def singular_rules #:doc:
[
[/(f)ish$/i, '\1\2ish'],
[/^(ox)en/i, '\1'],
[/(photo)s$/i, '\1'],
[/(o)es/i, '\1'],
[/(bus)es$/i, '\1'],
[/([m|l])ice/i, '\1ouse'],

@ -63,6 +63,7 @@ class InflectorTest < Test::Unit::TestCase
"perspective" => "perspectives",
"ox" => "oxen",
"photo" => "photos",
"buffalo" => "buffaloes",
"tomato" => "tomatoes",
"dwarf" => "dwarves",