Skip to content

Instantly share code, notes, and snippets.

@cvonkleist
Created March 3, 2011 21:47
Show Gist options
  • Save cvonkleist/853673 to your computer and use it in GitHub Desktop.
Save cvonkleist/853673 to your computer and use it in GitHub Desktop.
class MyModel
attribute :complex_object_store
def complex_object=(object)
self.complex_object_store = Base64.encode64(Marshal.dump(object))
end
def complex_object
Marshal.load(Base64.decode64(self.complex_object_store))
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment