diff options
author | Rolf Bjaanes <rolf@powow.no> | 2009-12-15 18:36:28 +0100 |
---|---|---|
committer | José Valim <jose.valim@gmail.com> | 2010-04-05 23:54:42 +0200 |
commit | 4eab983b955fe17cf02c6fe96cab1c8a309cd606 (patch) | |
tree | d4351ca0a97fa145487e5e3bee9738cd30e29ba9 /activesupport/lib | |
parent | efa7e96821a3d335fab9cd9ed1dfa6c6cd6744a2 (diff) | |
download | rails-4eab983b955fe17cf02c6fe96cab1c8a309cd606.tar.gz rails-4eab983b955fe17cf02c6fe96cab1c8a309cd606.tar.bz2 rails-4eab983b955fe17cf02c6fe96cab1c8a309cd606.zip |
Changed the way inflections for uncountables work for 'funky jeans' [#3576 state:resolved]
Signed-off-by: José Valim <jose.valim@gmail.com>
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/inflections.rb | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/inflector/inflections.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/inflections.rb b/activesupport/lib/active_support/inflections.rb index 8fb3fa9aa2..e7b5387ed7 100644 --- a/activesupport/lib/active_support/inflections.rb +++ b/activesupport/lib/active_support/inflections.rb @@ -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 diff --git a/activesupport/lib/active_support/inflector/inflections.rb b/activesupport/lib/active_support/inflector/inflections.rb index 785e245ea4..3caf78bc7d 100644 --- a/activesupport/lib/active_support/inflector/inflections.rb +++ b/activesupport/lib/active_support/inflector/inflections.rb @@ -148,7 +148,7 @@ module ActiveSupport 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) } |