From 48583f8bf74d1cefefea3cd6591bd546a9eaff6c Mon Sep 17 00:00:00 2001 From: Andrew White Date: Tue, 11 Dec 2012 13:57:05 +0000 Subject: Deprecate obsolete Time to DateTime fallback methods The Time.time_with_datetime_fallback, Time.utc_time and Time.local_time methods were added to handle the limitations of Ruby's native Time implementation. Those limitations no longer apply so we are deprecating them in 4.0 and they will be removed in 4.1. --- activerecord/lib/active_record/attribute_assignment.rb | 2 +- activerecord/lib/active_record/connection_adapters/column.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'activerecord/lib') diff --git a/activerecord/lib/active_record/attribute_assignment.rb b/activerecord/lib/active_record/attribute_assignment.rb index 6c5e2ac05d..ecfa556ab4 100644 --- a/activerecord/lib/active_record/attribute_assignment.rb +++ b/activerecord/lib/active_record/attribute_assignment.rb @@ -132,7 +132,7 @@ module ActiveRecord if object.class.send(:create_time_zone_conversion_attribute?, name, column) Time.zone.local(*set_values) else - Time.time_with_datetime_fallback(object.class.default_timezone, *set_values) + Time.send(object.class.default_timezone, *set_values) end end diff --git a/activerecord/lib/active_record/connection_adapters/column.rb b/activerecord/lib/active_record/connection_adapters/column.rb index 80984f39c9..df23dbfb60 100644 --- a/activerecord/lib/active_record/connection_adapters/column.rb +++ b/activerecord/lib/active_record/connection_adapters/column.rb @@ -240,7 +240,7 @@ module ActiveRecord # Treat 0000-00-00 00:00:00 as nil. return nil if year.nil? || (year == 0 && mon == 0 && mday == 0) - Time.time_with_datetime_fallback(Base.default_timezone, year, mon, mday, hour, min, sec, microsec) rescue nil + Time.send(Base.default_timezone, year, mon, mday, hour, min, sec, microsec) rescue nil end def fast_string_to_date(string) -- cgit v1.2.3