Changeset 8412
- Timestamp:
- 12/15/07 02:30:17 (2 years ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/dependencies.rb (modified) (1 diff)
- trunk/activesupport/lib/active_support/duration.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r8411 r8412 1 1 *SVN* 2 3 * Ruby 1.9 compatibility. #1689, #10466, #10468 [Cheah Chu Yeow, Jeremy Kemper] 2 4 3 5 * TimeZone#to_s uses UTC rather than GMT. #1689 [Cheah Chu Yeow] trunk/activesupport/lib/active_support/dependencies.rb
r8396 r8412 462 462 class Class 463 463 def const_missing(const_name) 464 # Bypass entire lookup process if we can get the constant from Object.465 # This is useful for Ruby 1.9 where Module#const_defined? looks up the466 # ancestors in the chain for the constant.467 return ::Object.const_get(const_name) if ::Object.const_defined?(const_name)468 469 464 if [Object, Kernel].include?(self) || parent == self 470 465 super trunk/activesupport/lib/active_support/duration.rb
r8399 r8412 65 65 66 66 def inspect #:nodoc: 67 consolidated = parts.inject( Hash.new(0)) { |h,part| h[part.first] += part.last; h }67 consolidated = parts.inject(::Hash.new(0)) { |h,part| h[part.first] += part.last; h } 68 68 [:years, :months, :days, :minutes, :seconds].map do |length| 69 69 n = consolidated[length]