diff --git a/activesupport/lib/active_support/core_ext/date_time/conversions.rb b/activesupport/lib/active_support/core_ext/date_time/conversions.rb index b6a3c02dd62823bee3eaa581c48d5afa8ccb0e1d..262c03540b6dd0af4d3e4a51f788ffcb9145b07a 100644 --- a/activesupport/lib/active_support/core_ext/date_time/conversions.rb +++ b/activesupport/lib/active_support/core_ext/date_time/conversions.rb @@ -4,10 +4,6 @@ require 'active_support/values/time_zone' class DateTime - # Ruby 1.9 has DateTime#to_time which internally relies on Time. We define our own #to_time which allows - # DateTimes outside the range of what can be created with Time. - remove_method :to_time - # Convert to a formatted string. See Time::DATE_FORMATS for predefined formats. # # This method is aliased to to_s. @@ -57,16 +53,6 @@ def readable_inspect alias_method :default_inspect, :inspect alias_method :inspect, :readable_inspect - # Attempts to convert self to a Ruby Time object; returns self if out of range of Ruby Time class. - # If self has an offset other than 0, self will just be returned unaltered, since there's no clean way to map it to a Time. - def to_time - if offset == 0 - ::Time.utc_time(year, month, day, hour, min, sec, sec_fraction * 1000000) - else - self - end - end - # Returns DateTime with local offset for given year if format is local else offset is zero # # DateTime.civil_from_format :local, 2012