Permalink
Browse files

Merge [6099] from trunk. Compatibility with Ruby 1.8.6: make private …

…Time#to_date and #to_datetime public.

git-svn-id: http://svn-commit.rubyonrails.org/rails/branches/1-2-stable@6281 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
1 parent 9679cb4 commit bbe3dea3fa46355095818d193c7b74d03638ef5d @jeremy jeremy committed Mar 2, 2007
View
@@ -1,5 +1,8 @@
*SVN*
+* Ruby 1.8.6 and 1.9 define private Time#to_date and #to_datetime; make them
+public for compatibility. [Jeremy Kemper]
+
* Deprecation: warn on stderr if RAILS_DEFAULT_LOGGER isn't set yet. [Jeremy Kemper]
@@ -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/calculations'
require File.dirname(__FILE__) + '/time/conversions'
@@ -1,6 +1,3 @@
-require 'date'
-require 'time'
-
module ActiveSupport #:nodoc:
module CoreExtensions #:nodoc:
module Time #:nodoc:

0 comments on commit bbe3dea

Please sign in to comment.