Skip to content

Commit

Permalink
Added inflection rules for "sh" words, like "wish" and "fish" #755 [p…
Browse files Browse the repository at this point in the history
…hillip@pjbsoftware.com]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@844 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
dhh committed Mar 6, 2005
1 parent 7267db5 commit 6cae2b7
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 2 deletions.
2 changes: 2 additions & 0 deletions activesupport/CHANGELOG
@@ -1,5 +1,7 @@
*SVN*

* Added inflection rules for "sh" words, like "wish" and "fish" #755 [phillip@pjbsoftware.com]

* Fixed an exception when using Ajax based requests from Safari because Safari appends a \000 to the post body. Symbols can't have \000 in them so indifferent access would throw an exception in the constructor. Indifferent hashes now use strings internally instead. #746 [Tobias Luetke]

* Added String#to_time and String#to_date for wrapping ParseDate
Expand Down
4 changes: 3 additions & 1 deletion activesupport/lib/active_support/inflector.rb
Expand Up @@ -57,6 +57,7 @@ def constantize(camel_cased_word)
private
def plural_rules #:doc:
[
[/fish$/, 'fish'], # fish
[/(x|ch|ss|sh)$/, '\1es'], # search, switch, fix, box, process, address
[/series$/, '\1series'],
[/([^aeiouy]|qu)ies$/, '\1y'],
Expand All @@ -74,7 +75,8 @@ def plural_rules #:doc:

def singular_rules #:doc:
[
[/(x|ch|ss)es$/, '\1'],
[/fish$/, 'fish'],
[/(x|ch|ss|sh)es$/, '\1'],
[/movies$/, 'movie'],
[/series$/, 'series'],
[/([^aeiouy]|qu)ies$/, '\1y'],
Expand Down
4 changes: 3 additions & 1 deletion activesupport/test/inflector_test.rb
Expand Up @@ -17,7 +17,9 @@ class InflectorTest < Test::Unit::TestCase
"process" => "processes",
"address" => "addresses",
"case" => "cases",
"stack" => "stacks",
"stack" => "stacks",
"wish" => "wishes",
"fish" => "fish",

"category" => "categories",
"query" => "queries",
Expand Down

0 comments on commit 6cae2b7

Please sign in to comment.