From 593b1b837d24e61ea8f5386d66669585f3c14d5a Mon Sep 17 00:00:00 2001 From: Jeremy Kemper Date: Thu, 1 Feb 2007 18:06:16 +0000 Subject: Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Active Support. Make it public to preserve compatibility. git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6099 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/core_ext/time.rb | 10 ++++++++++ activesupport/lib/active_support/core_ext/time/conversions.rb | 3 --- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'activesupport/lib/active_support/core_ext') diff --git a/activesupport/lib/active_support/core_ext/time.rb b/activesupport/lib/active_support/core_ext/time.rb index a802c065a7..a9e6a4385c 100644 --- a/activesupport/lib/active_support/core_ext/time.rb +++ b/activesupport/lib/active_support/core_ext/time.rb @@ -1,3 +1,13 @@ +require 'date' +require 'time' + +# Ruby 1.8-cvs and 1.9 define private Time#to_date +class Time + %w(to_date to_datetime).each do |method| + public method if private_instance_methods.include?(method) + end +end + require File.dirname(__FILE__) + '/time/behavior' require File.dirname(__FILE__) + '/time/calculations' require File.dirname(__FILE__) + '/time/conversions' diff --git a/activesupport/lib/active_support/core_ext/time/conversions.rb b/activesupport/lib/active_support/core_ext/time/conversions.rb index 6e8dae21f1..f2ff0e06a8 100644 --- a/activesupport/lib/active_support/core_ext/time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/time/conversions.rb @@ -1,6 +1,3 @@ -require 'date' -require 'time' - module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module Time #:nodoc: -- cgit v1.2.3