aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/inflector.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-15 02:02:20 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-15 02:02:20 +0000
commit603ab7d812931d5f85171393b30665b244a6187e (patch)
tree06be560c4c73b4b7a78c01966333255655c6ad9f /activesupport/lib/inflector.rb
parentb1999be5a7efd67e2602c37ed898aa8433661863 (diff)
downloadrails-603ab7d812931d5f85171393b30665b244a6187e.tar.gz
rails-603ab7d812931d5f85171393b30665b244a6187e.tar.bz2
rails-603ab7d812931d5f85171393b30665b244a6187e.zip
Fixed Inflector for words like "news" and "series" that are the same in plural and singular #603 [echion], #615 [marcenuc]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@618 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib/inflector.rb')
-rw-r--r--activesupport/lib/inflector.rb3
1 files changed, 3 insertions, 0 deletions
diff --git a/activesupport/lib/inflector.rb b/activesupport/lib/inflector.rb
index a9b2f87be4..e09208dd4f 100644
--- a/activesupport/lib/inflector.rb
+++ b/activesupport/lib/inflector.rb
@@ -58,6 +58,7 @@ module Inflector
def plural_rules #:doc:
[
[/(x|ch|ss|sh)$/, '\1es'], # search, switch, fix, box, process, address
+ [/series$/, '\1series'],
[/([^aeiouy]|qu)ies$/, '\1y'],
[/([^aeiouy]|qu)y$/, '\1ies'], # query, ability, agency
[/(?:([^f])fe|([lr])f)$/, '\1\2ves'], # half, safe, wife
@@ -75,6 +76,7 @@ module Inflector
[
[/(x|ch|ss)es$/, '\1'],
[/movies$/, 'movie'],
+ [/series$/, 'series'],
[/([^aeiouy]|qu)ies$/, '\1y'],
[/([lr])ves$/, '\1f'],
[/([^f])ves$/, '\1fe'],
@@ -84,6 +86,7 @@ module Inflector
[/men$/, 'man'],
[/status$/, 'status'],
[/children$/, 'child'],
+ [/news$/, 'news'],
[/s$/, '']
]
end