aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-07-04 15:15:13 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-07-04 15:15:13 +0000
commitf5db702901408d7d74a3dec0cb6cdcaf987223dd (patch)
treea0aa84715e62b2598a8bef984e603aeb070d1324 /activesupport/lib
parent930f33657c7264578bea198f65222471b8ab2d2e (diff)
downloadrails-f5db702901408d7d74a3dec0cb6cdcaf987223dd.tar.gz
rails-f5db702901408d7d74a3dec0cb6cdcaf987223dd.tar.bz2
rails-f5db702901408d7d74a3dec0cb6cdcaf987223dd.zip
More inflector fixes #1599 [foamdino@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1662 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r--activesupport/lib/active_support/inflector.rb9
1 files changed, 6 insertions, 3 deletions
diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb
index 1940cfd0ca..2ff9d92b93 100644
--- a/activesupport/lib/active_support/inflector.rb
+++ b/activesupport/lib/active_support/inflector.rb
@@ -58,7 +58,7 @@ module Inflector
def plural_rules #:doc:
[
[/(fish)$/i, '\1\2'], # fish
- [/(information)$/i, '\1'], # information (plural noun)
+ [/(information|equipment|money)$/i, '\1'], # plural nouns
[/^(ox)$/i, '\1\2en'], # ox
[/([m|l])ouse/i, '\1ice'], # mouse, louse
[/(x|ch|ss|sh)$/i, '\1es'], # search, switch, fix, box, process, address
@@ -73,8 +73,10 @@ module Inflector
[/(m)an$/i, '\1\2en'], # man, woman, spokesman
[/(c)hild$/i, '\1\2hildren'], # child
[/(photo)$/i, '\1s'],
- [/(o)$/i, '\1\2es'], # buffalo, tomato
+ [/(buffal|tomat)o$/i, '\1\2oes'], # buffalo, tomato
[/(bu)s$/i, '\1\2ses'], # bus
+ [/(alias)/i, '\1es'], # alias
+ [/([octop|vir])us$/i, '\1i'], # octopus, virus - virus has no defined plural (according to Latin/dictionary.com), but viri is better than viruses/viruss
[/s$/i, 's'], # no change (compatibility)
[/$/, 's']
]
@@ -84,7 +86,8 @@ module Inflector
[
[/(f)ish$/i, '\1\2ish'],
[/^(ox)en/i, '\1'],
- [/(photo)s$/i, '\1'],
+ [/(alias)es$/i, '\1'],
+ [/([octop|vir])i$/i, '\1us'],
[/(o)es/i, '\1'],
[/(bus)es$/i, '\1'],
[/([m|l])ice/i, '\1ouse'],