aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/inflections.rb
diff options
context:
space:
mode:
authorDan Pickett <dpickett@enlightsolutions.com>2011-02-07 21:39:46 -0500
committerSantiago Pastorino <santiago@wyeworks.com>2011-02-16 15:08:25 -0200
commit1754bd9b208e8d9207c226d1ffb3cee490856a78 (patch)
tree86880f901243aeeb35bd25bc67e6ed9eb3de1750 /activesupport/lib/active_support/inflections.rb
parent2eed9286ce3af77d29bdd20b4c2a5fa93baf03b1 (diff)
downloadrails-1754bd9b208e8d9207c226d1ffb3cee490856a78.tar.gz
rails-1754bd9b208e8d9207c226d1ffb3cee490856a78.tar.bz2
rails-1754bd9b208e8d9207c226d1ffb3cee490856a78.zip
handle double pluralization for irregular plurals
[#6363] Signed-off-by: Santiago Pastorino <santiago@wyeworks.com>
Diffstat (limited to 'activesupport/lib/active_support/inflections.rb')
-rw-r--r--activesupport/lib/active_support/inflections.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/inflections.rb b/activesupport/lib/active_support/inflections.rb
index e7b5387ed7..06ceccdb22 100644
--- a/activesupport/lib/active_support/inflections.rb
+++ b/activesupport/lib/active_support/inflections.rb
@@ -4,10 +4,12 @@ module ActiveSupport
inflect.plural(/s$/i, 's')
inflect.plural(/(ax|test)is$/i, '\1es')
inflect.plural(/(octop|vir)us$/i, '\1i')
+ inflect.plural(/(octop|vir)i$/i, '\1i')
inflect.plural(/(alias|status)$/i, '\1es')
inflect.plural(/(bu)s$/i, '\1ses')
inflect.plural(/(buffal|tomat)o$/i, '\1oes')
inflect.plural(/([ti])um$/i, '\1a')
+ inflect.plural(/([ti])a$/i, '\1a')
inflect.plural(/sis$/i, 'ses')
inflect.plural(/(?:([^f])fe|([lr])f)$/i, '\1\2ves')
inflect.plural(/(hive)$/i, '\1s')
@@ -15,7 +17,9 @@ module ActiveSupport
inflect.plural(/(x|ch|ss|sh)$/i, '\1es')
inflect.plural(/(matr|vert|ind)(?:ix|ex)$/i, '\1ices')
inflect.plural(/([m|l])ouse$/i, '\1ice')
+ inflect.plural(/([m|l])ice$/i, '\1ice')
inflect.plural(/^(ox)$/i, '\1en')
+ inflect.plural(/^(oxen)$/i, '\1')
inflect.plural(/(quiz)$/i, '\1zes')
inflect.singular(/s$/i, '')