Changeset 8975
- Timestamp:
- 03/03/08 03:49:37 (1 year ago)
- Files:
-
- trunk/activesupport/CHANGELOG (modified) (1 diff)
- trunk/activesupport/lib/active_support/time_with_zone.rb (modified) (1 diff)
- trunk/activesupport/test/core_ext/time_with_zone_test.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/activesupport/CHANGELOG
r8974 r8975 1 1 *SVN* 2 3 * Adding TimeWithZone #marshal_dump and #marshal_load [Geoff Buesing] 2 4 3 5 * Add OrderedHash#to_hash [josh] trunk/activesupport/lib/active_support/time_with_zone.rb
r8886 r8975 188 188 def freeze 189 189 self 190 end 191 192 def marshal_dump 193 [utc, time_zone.name, time] 194 end 195 196 def marshal_load(variables) 197 initialize(variables[0], ::TimeZone[variables[1]], variables[2]) 190 198 end 191 199 trunk/activesupport/test/core_ext/time_with_zone_test.rb
r8886 r8975 209 209 assert_instance_of ActiveSupport::TimeWithZone, @twz.months_since(1) 210 210 assert_equal Time.utc(2000, 1, 31, 19, 0 ,0), @twz.months_since(1).time 211 end 212 213 def test_marshal_dump_and_load 214 marshal_str = Marshal.dump(@twz) 215 mtime = Marshal.load(marshal_str) 216 assert_equal Time.utc(2000, 1, 1, 0), mtime.utc 217 assert_equal TimeZone['Eastern Time (US & Canada)'], mtime.time_zone 218 assert_equal Time.utc(1999, 12, 31, 19), mtime.time 211 219 end 212 220