diff --git a/activesupport/CHANGELOG b/activesupport/CHANGELOG index 007b61b755..9e21a8beab 100644 --- a/activesupport/CHANGELOG +++ b/activesupport/CHANGELOG @@ -1,5 +1,8 @@ *SVN* +* Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Active +Support. Make it public to preserve compatibility. [Jeremy Kemper] + * Full test coverage for Inflector. #7228 [Dan Kubb] * :db format for Date#to_s [Jeremy Kemper] 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: