Skip to content

Commit

Permalink
Fixed inflections of "index/indices" #1766 [damn_pepe@gmail.com]
Browse files Browse the repository at this point in the history
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1881 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Jul 22, 2005
1 parent ecb0e39 commit fb2dd49
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions activesupport/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions activesupport/lib/active_support/inflector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def plural_rules #:doc:
[
[/^(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
Expand All @@ -106,7 +106,7 @@ def plural_rules #:doc:
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'],
Expand Down
2 changes: 2 additions & 0 deletions activesupport/test/inflector_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ class InflectorTest < Test::Unit::TestCase

"archive" => "archives",

"index" => "indices",

"wife" => "wives",
"safe" => "saves",
"half" => "halves",
Expand Down

0 comments on commit fb2dd49

Please sign in to comment.