From 6560448b460f16db196efe42d5fc3d51b27ea651 Mon Sep 17 00:00:00 2001 From: Adam Rice Date: Wed, 22 Feb 2017 14:16:59 +1100 Subject: Preload to_datetime before freezing a TimeWithZone instance --- activesupport/lib/active_support/time_with_zone.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'activesupport/lib') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index 889f71c4f3..857cc1a664 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -427,7 +427,8 @@ module ActiveSupport end def freeze - period; utc; time # preload instance variables before freezing + # preload instance variables before freezing + period; utc; time; to_datetime super end -- cgit v1.2.3