diff options
author | Rick Olson <technoweenie@gmail.com> | 2007-01-23 05:32:08 +0000 |
---|---|---|
committer | Rick Olson <technoweenie@gmail.com> | 2007-01-23 05:32:08 +0000 |
commit | be7f86e37ac21585ad2621e2e0938c68a7a71360 (patch) | |
tree | ac346d834b760ec7a551397a133113a7801cb9cf /activesupport/lib | |
parent | a44cee2549e04e6e586f0f9432d98bb2dd4e3625 (diff) | |
download | rails-be7f86e37ac21585ad2621e2e0938c68a7a71360.tar.gz rails-be7f86e37ac21585ad2621e2e0938c68a7a71360.tar.bz2 rails-be7f86e37ac21585ad2621e2e0938c68a7a71360.zip |
Added test coverage for Inflector.inflections.clear. Closes #7179. [Rich Collins]. Remove unused code from Duration#inspect. Closes #7180. [Rich Collins]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6022 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index 8e518cb00b..5279c4435a 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -55,7 +55,7 @@ module ActiveSupport def inspect #:nodoc: consolidated = parts.inject(Hash.new(0)) { |h,part| h[part.first] += part.last; h } - [:years, :months, :days, :hours, :minutes, :seconds].map do |length| + [:years, :months, :days, :minutes, :seconds].map do |length| n = consolidated[length] "#{n} #{n == 1 ? length.to_s.singularize : length.to_s}" if n.nonzero? end.compact.to_sentence |