public
Fork of rails/rails
Description: Ruby on Rails
Homepage: http://rubyonrails.org
Clone URL: git://github.com/ddollar/rails.git
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
jeremy (author)
Fri Dec 14 18:30:17 -0800 2007
commit  6743504ba2091d180f8f9318bec4d97d6ab347c3
tree    d9d4d50b7d1f3e31ca9203532f0eb34985117a7b
parent  3df9fb53acb7b2fb445ba197da7340cfdf4fc78c
...
1
2
 
 
3
4
5
...
1
2
3
4
5
6
7
0
@@ -1,5 +1,7 @@
0
 *SVN*
0
 
0
+* Ruby 1.9 compatibility. #1689, #10466, #10468 [Cheah Chu Yeow, Jeremy Kemper]
0
+
0
 * TimeZone#to_s uses UTC rather than GMT. #1689 [Cheah Chu Yeow]
0
 
0
 * Refactor of Hash#symbolize_keys! to use Hash#replace. Closes #10420 [ReinH]
...
461
462
463
464
465
466
467
468
469
470
471
...
461
462
463
 
 
 
 
 
464
465
466
0
@@ -461,11 +461,6 @@ end
0
 
0
 class Class
0
   def const_missing(const_name)
0
- # Bypass entire lookup process if we can get the constant from Object.
0
- # This is useful for Ruby 1.9 where Module#const_defined? looks up the
0
- # ancestors in the chain for the constant.
0
- return ::Object.const_get(const_name) if ::Object.const_defined?(const_name)
0
-
0
     if [Object, Kernel].include?(self) || parent == self
0
       super
0
     else
...
64
65
66
67
 
68
69
70
...
64
65
66
 
67
68
69
70
0
@@ -64,7 +64,7 @@ module ActiveSupport
0
     alias :until :ago
0
 
0
     def inspect #:nodoc:
0
- consolidated = parts.inject(Hash.new(0)) { |h,part| h[part.first] += part.last; h }
0
+ consolidated = parts.inject(::Hash.new(0)) { |h,part| h[part.first] += part.last; h }
0
       [:years, :months, :days, :minutes, :seconds].map do |length|
0
         n = consolidated[length]
0
         "#{n} #{n == 1 ? length.to_s.singularize : length.to_s}" if n.nonzero?

Comments

    No one has commented yet.