From 79e44a5ee484f977c2cad8a4cffe882b816340a1 Mon Sep 17 00:00:00 2001 From: gbuesing Date: Thu, 8 May 2008 22:21:51 -0500 Subject: Base#instantiate_time_object: eliminate check for Time.zone, since we can assume this is set if time_zone_aware_attributes is set to true --- activerecord/CHANGELOG | 2 ++ activerecord/lib/active_record/base.rb | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'activerecord') diff --git a/activerecord/CHANGELOG b/activerecord/CHANGELOG index f223e1f67f..597b876f22 100644 --- a/activerecord/CHANGELOG +++ b/activerecord/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Base#instantiate_time_object: eliminate check for Time.zone, since we can assume this is set if time_zone_aware_attributes is set to true [Geoff Buesing] + * Time zone aware attribute methods use Time.zone.parse instead of #to_time for String arguments, so that offset information in String is respected. Resolves #105. [Scott Fleckenstein, Geoff Buesing] * Added change_table for migrations (Jeff Dean) [#71]. Example: diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index 12234184c1..b600e8ecfd 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -2571,7 +2571,7 @@ module ActiveRecord #:nodoc: end def instantiate_time_object(name, values) - if Time.zone && self.class.time_zone_aware_attributes && !self.class.skip_time_zone_conversion_for_attributes.include?(name.to_sym) + if self.class.time_zone_aware_attributes && !self.class.skip_time_zone_conversion_for_attributes.include?(name.to_sym) Time.zone.local(*values) else Time.time_with_datetime_fallback(@@default_timezone, *values) -- cgit v1.2.3