Skip to content

Commit

Permalink
Merge pull request #3901 from mark-rushakoff/inflection-regex-fix
Browse files Browse the repository at this point in the history
Fix inflection regexes for mouse, mice
  • Loading branch information
josevalim committed Dec 8, 2011
2 parents a505b13 + 6f253fb commit 0144f4f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 3 additions & 3 deletions activesupport/lib/active_support/inflections.rb
Expand Up @@ -16,8 +16,8 @@ module ActiveSupport
inflect.plural(/([^aeiouy]|qu)y$/i, '\1ies')
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(/(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')
Expand All @@ -35,7 +35,7 @@ module ActiveSupport
inflect.singular(/(s)eries$/i, '\1eries')
inflect.singular(/(m)ovies$/i, '\1ovie')
inflect.singular(/(x|ch|ss|sh)es$/i, '\1')
inflect.singular(/([m|l])ice$/i, '\1ouse')
inflect.singular(/(m|l)ice$/i, '\1ouse')
inflect.singular(/(bus)es$/i, '\1')
inflect.singular(/(o)es$/i, '\1')
inflect.singular(/(shoe)s$/i, '\1')
Expand Down
6 changes: 5 additions & 1 deletion activesupport/test/inflector_test_cases.rb
Expand Up @@ -104,7 +104,11 @@ module InflectorTestCases
"edge" => "edges",

"cow" => "kine",
"database" => "databases"
"database" => "databases",

# regression tests against improper inflection regexes
"|ice" => "|ices",
"|ouse" => "|ouses"
}

CamelToUnderscore = {
Expand Down

0 comments on commit 0144f4f

Please sign in to comment.