diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-22 06:52:10 +0000 |
---|---|---|
committer | David Heinemeier Hansson <david@loudthinking.com> | 2005-07-22 06:52:10 +0000 |
commit | fb2dd492d6c73207d7fad2ee1df152713e1dcaa9 (patch) | |
tree | 497f703b4fed498b3dfbe105af9c37eb2d846fa5 | |
parent | ecb0e3974123c7dfc503311f014f30fa1b77943b (diff) | |
download | rails-fb2dd492d6c73207d7fad2ee1df152713e1dcaa9.tar.gz rails-fb2dd492d6c73207d7fad2ee1df152713e1dcaa9.tar.bz2 rails-fb2dd492d6c73207d7fad2ee1df152713e1dcaa9.zip |
Fixed inflections of "index/indices" #1766 [damn_pepe@gmail.com]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1881 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
-rw-r--r-- | activesupport/CHANGELOG | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/inflector.rb | 4 | ||||
-rw-r--r-- | activesupport/test/inflector_test.rb | 2 |
3 files changed, 6 insertions, 2 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index cd8896ade9..2e2e16ccd9 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Fixed inflections of "index/indices" #1766 [damn_pepe@gmail.com] + * Added stripping of _id to String#humanize, so "employee_id" becomes "Employee" #1574 [Justin French] * Factor Fixnum and Bignum extensions into Integer extensions [Nicholas Seckar] diff --git a/activesupport/lib/active_support/inflector.rb b/activesupport/lib/active_support/inflector.rb index 149b962579..ae1cbd213d 100644 --- a/activesupport/lib/active_support/inflector.rb +++ b/activesupport/lib/active_support/inflector.rb @@ -82,7 +82,7 @@ module Inflector [ [/^(ox)$/i, '\1\2en'], # ox [/([m|l])ouse$/i, '\1ice'], # mouse, louse - [/(matr|vert)ix|ex$/i, '\1ices'], # matrix, vertex, index + [/(matr|vert|ind)ix|ex$/i, '\1ices'], # matrix, vertex, index [/(x|ch|ss|sh)$/i, '\1es'], # search, switch, fix, box, process, address [/([^aeiouy]|qu)ies$/i, '\1y'], [/([^aeiouy]|qu)y$/i, '\1ies'], # query, ability, agency @@ -106,7 +106,7 @@ module Inflector def singular_rules #:doc: [ [/(matr)ices$/i, '\1ix'], - [/(vert)ices$/i, '\1ex'], + [/(vert|ind)ices$/i, '\1ex'], [/^(ox)en/i, '\1'], [/(alias)es$/i, '\1'], [/([octop|vir])i$/i, '\1us'], diff --git a/activesupport/test/inflector_test.rb b/activesupport/test/inflector_test.rb index 26aea141fe..4337dfd9d6 100644 --- a/activesupport/test/inflector_test.rb +++ b/activesupport/test/inflector_test.rb @@ -29,6 +29,8 @@ class InflectorTest < Test::Unit::TestCase "archive" => "archives", + "index" => "indices", + "wife" => "wives", "safe" => "saves", "half" => "halves", |