Skip to content

Commit

Permalink
Base#instantiate_time_object: eliminate check for Time.zone, since we…
Browse files Browse the repository at this point in the history
… can assume this is set if time_zone_aware_attributes is set to true
  • Loading branch information
gbuesing committed May 9, 2008
1 parent 4f03190 commit 79e44a5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions activerecord/CHANGELOG
@@ -1,5 +1,7 @@
*SVN* *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] * 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: * Added change_table for migrations (Jeff Dean) [#71]. Example:
Expand Down
2 changes: 1 addition & 1 deletion activerecord/lib/active_record/base.rb
Expand Up @@ -2571,7 +2571,7 @@ def assign_multiparameter_attributes(pairs)
end end


def instantiate_time_object(name, values) 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) Time.zone.local(*values)
else else
Time.time_with_datetime_fallback(@@default_timezone, *values) Time.time_with_datetime_fallback(@@default_timezone, *values)
Expand Down

0 comments on commit 79e44a5

Please sign in to comment.