diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/inflector.rb | 2 | ||||
-rw-r--r-- | activesupport/test/inflector_test.rb | 2 |
3 files changed, 5 insertions, 1 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index e425e4f3c5..a40c945721 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -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, 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] diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index 0e8fad221c..1940cfd0ca 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -65,6 +65,7 @@ module Inflector [/(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 @@ module Inflector [/([^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'], diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 37687636ad..6f088c9c20 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -27,6 +27,8 @@ class InflectorTest < Test::Unit::TestCase "agency" => "agencies", "movie" => "movies", + "archive" => "archives", + "wife" => "wives", "safe" => "saves", "half" => "halves", |