aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-02 19:05:47 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-02 19:05:47 +0000
commitda4b15fe188dfd1fea42cadde6f984f9a1bd3a85 (patch)
treec5f822ad937cd52745c98f4633a7e10daca6b349
parentc196db9527843979f884f331499f0b8963f99dcd (diff)
downloadrails-da4b15fe188dfd1fea42cadde6f984f9a1bd3a85.tar.gz
rails-da4b15fe188dfd1fea42cadde6f984f9a1bd3a85.tar.bz2
rails-da4b15fe188dfd1fea42cadde6f984f9a1bd3a85.zip
More inflectoring #1490
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1616 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r--activesupport/CHANGELOG2
-rw-r--r--activesupport/lib/active_support/inflector.rb2
-rw-r--r--activesupport/test/inflector_test.rb2
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",