Permalink
Browse files

Changed the way inflections for uncountables work for 'funky jeans' [#…

…3576 state:resolved]

Signed-off-by: José Valim <jose.valim@gmail.com>
  • Loading branch information...
rolfb authored and josevalim committed Dec 15, 2009
1 parent efa7e96 commit 4eab983b955fe17cf02c6fe96cab1c8a309cd606
@@ -51,6 +51,6 @@ module ActiveSupport
inflect.irregular('move', 'moves')
inflect.irregular('cow', 'kine')
- inflect.uncountable(%w(equipment information rice money species series fish sheep))
+ inflect.uncountable(%w(equipment information rice money species series fish sheep jeans))
end
end
@@ -148,7 +148,7 @@ def pluralize(word)
def singularize(word)
result = word.to_s.dup
- if inflections.uncountables.include?(result.downcase)
+ if inflections.uncountables.any? { |inflection| result =~ /#{inflection}\Z/i }
result
else
inflections.singulars.each { |(rule, replacement)| break if result.gsub!(rule, replacement) }
@@ -12,6 +12,8 @@ module InflectorTestCases
"stack" => "stacks",
"wish" => "wishes",
"fish" => "fish",
+ "jeans" => "jeans",
+ "funky jeans" => "funky jeans",
"category" => "categories",
"query" => "queries",

0 comments on commit 4eab983

Please sign in to comment.