From 10d9d0b6fe023df1be0d87ca95bb739bb7eb30ba Mon Sep 17 00:00:00 2001 From: Geoff Buesing Date: Mon, 3 Mar 2008 03:49:37 +0000 Subject: Adding TimeWithZone #marshal_dump and #marshal_load git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8975 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- activesupport/lib/active_support/time_with_zone.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/time_with_zone.rb b/activesupport/lib/active_support/time_with_zone.rb index cd4ea8c532..c6fa118b55 100644 --- a/activesupport/lib/active_support/time_with_zone.rb +++ b/activesupport/lib/active_support/time_with_zone.rb @@ -188,6 +188,14 @@ module ActiveSupport def freeze self end + + def marshal_dump + [utc, time_zone.name, time] + end + + def marshal_load(variables) + initialize(variables[0], ::TimeZone[variables[1]], variables[2]) + end # Ensure proxy class responds to all methods that underlying time instance responds to def respond_to?(sym) -- cgit v1.2.3