Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Changeset 8412

Show
Ignore:
Timestamp:
12/15/07 02:30:17 (5 months ago)
Author:
bitsweat
Message:

Revert const_missing bypass in favor of Duration constant lookup tweak

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/activesupport/CHANGELOG

    r8411 r8412  
    11*SVN* 
     2 
     3* Ruby 1.9 compatibility.  #1689, #10466, #10468 [Cheah Chu Yeow, Jeremy Kemper] 
    24 
    35* TimeZone#to_s uses UTC rather than GMT.  #1689 [Cheah Chu Yeow] 
  • trunk/activesupport/lib/active_support/dependencies.rb

    r8396 r8412  
    462462class Class 
    463463  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 the 
    466     # ancestors in the chain for the constant. 
    467     return ::Object.const_get(const_name) if ::Object.const_defined?(const_name) 
    468  
    469464    if [Object, Kernel].include?(self) || parent == self 
    470465      super 
  • trunk/activesupport/lib/active_support/duration.rb

    r8399 r8412  
    6565 
    6666    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 } 
    6868      [:years, :months, :days, :minutes, :seconds].map do |length| 
    6969        n = consolidated[length]