From 6743504ba2091d180f8f9318bec4d97d6ab347c3 Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Sat, 15 Dec 2007 02:30:17 +0000 Subject: Revert const_missing bypass in favor of Duration constant lookup tweak git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8412 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/duration.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'activesupport/lib/active_support/duration.rb') diff --git a/activesupport/lib/active_support/duration.rb b/activesupport/lib/active_support/duration.rb index cbee4fd0ca..82b38e79b5 100644 --- a/activesupport/lib/active_support/duration.rb +++ b/activesupport/lib/active_support/duration.rb @@ -64,7 +64,7 @@ module ActiveSupport alias :until :ago def inspect #:nodoc: - consolidated = parts.inject(Hash.new(0)) { |h,part| h[part.first] += part.last; h } + consolidated = parts.inject(::Hash.new(0)) { |h,part| h[part.first] += part.last; h } [:years, :months, :days, :minutes, :seconds].map do |length| n = consolidated[length] "#{n} #{n == 1 ? length.to_s.singularize : length.to_s}" if n.nonzero? -- cgit v1.2.3