Skip to content

Instantly share code, notes, and snippets.

@giom
Created March 23, 2010 12:13
Show Gist options
  • Save giom/341103 to your computer and use it in GitHub Desktop.
Save giom/341103 to your computer and use it in GitHub Desktop.
Strange bug with Marshaling
class Time
attr_accessor :test
end
t = Time.now
mt = Marshal.dump [t,t]
Marshal.load(mt) == [t,t] #=> true
t.test = t - 31557600
mt = Marshal.dump [t,t]
Marshal.load(mt) == [t,t] #=> false
Marshal.load(mt) == [t,t.test] #=> true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment