diff options
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/CHANGELOG | 2 | ||||
-rw-r--r-- | activesupport/lib/active_support/dependencies.rb | 5 | ||||
-rw-r--r-- | activesupport/lib/active_support/duration.rb | 2 |
3 files changed, 3 insertions, 6 deletions
diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index c39b427c90..7ebf6f2610 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Ruby 1.9 compatibility. #1689, #10466, #10468 [Cheah Chu Yeow, Jeremy Kemper] + * TimeZone#to_s uses UTC rather than GMT. #1689 [Cheah Chu Yeow] * Refactor of Hash#symbolize_keys! to use Hash#replace. Closes #10420 [ReinH] diff --git a/activesupport/lib/active_support/dependencies.rb b/activesupport/lib/active_support/dependencies.rb index d1ca9f0473..6a5cfbf2e5 100644 --- a/activesupport/lib/active_support/dependencies.rb +++ b/activesupport/lib/active_support/dependencies.rb @@ -461,11 +461,6 @@ end class Class def const_missing(const_name) - # Bypass entire lookup process if we can get the constant from Object. - # This is useful for Ruby 1.9 where Module#const_defined? looks up the - # ancestors in the chain for the constant. - return ::Object.const_get(const_name) if ::Object.const_defined?(const_name) - if [Object, Kernel].include?(self) || parent == self super else 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? |