Skip to content
This repository
Browse code

no more need to make Time#to_date and Time#to_datetime public

they are public in actual 1.9 ruby version (tested at least in 1.9.2-p180)
  • Loading branch information...
commit 9d97173c5a3f023e50f85503c120fbad9d0b26d2 1 parent fa5adfb
Sergey Nartimov authored December 22, 2011
1  activesupport/lib/active_support/core_ext/string/conversions.rb
... ...
@@ -1,5 +1,4 @@
1 1
 require 'date'
2  
-require 'active_support/core_ext/time/publicize_conversion_methods'
3 2
 require 'active_support/core_ext/time/calculations'
4 3
 
5 4
 class String
1  activesupport/lib/active_support/core_ext/time/conversions.rb
... ...
@@ -1,5 +1,4 @@
1 1
 require 'active_support/inflector/methods'
2  
-require 'active_support/core_ext/time/publicize_conversion_methods'
3 2
 require 'active_support/values/time_zone'
4 3
 
5 4
 class Time
10  activesupport/lib/active_support/core_ext/time/publicize_conversion_methods.rb
... ...
@@ -1,10 +0,0 @@
1  
-require 'date'
2  
-
3  
-class Time
4  
-  # Ruby 1.8-cvs and early 1.9 series define private Time#to_date
5  
-  %w(to_date to_datetime).each do |method|
6  
-    if private_instance_methods.include?(method) || private_instance_methods.include?(method.to_sym)
7  
-      public method
8  
-    end
9  
-  end
10  
-end
1  activesupport/lib/active_support/time.rb
@@ -13,7 +13,6 @@ module ActiveSupport
13 13
 require 'date'
14 14
 require 'time'
15 15
 
16  
-require 'active_support/core_ext/time/publicize_conversion_methods'
17 16
 require 'active_support/core_ext/time/marshal'
18 17
 require 'active_support/core_ext/time/acts_like'
19 18
 require 'active_support/core_ext/time/calculations'

0 notes on commit 9d97173

Please sign in to comment.
Something went wrong with that request. Please try again.