Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Ruby 1.8-cvs and 1.9 define a private Time#to_date that overrides Act…

…ive Support. Make it public to preserve compatibility.

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@6099 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information...
commit 593b1b837d24e61ea8f5386d66669585f3c14d5a 1 parent 416091d
@jeremy jeremy authored
View
3  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]
View
10 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'
View
3  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:
Please sign in to comment.
Something went wrong with that request. Please try again.