-
-
Save Thorsson/aa40352f2550f5d74551c8b91c71f8cb to your computer and use it in GitHub Desktop.
Revisions
-
keichan34 created this gist
Sep 5, 2013 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,11 @@ module ActiveRecordMarshalable def marshal_dump [attributes, self.association_cache, instance_variable_get(:@new_record)] end def marshal_load data send :initialize, data[0] instance_variable_set :@association_cache, data[1] instance_variable_set :@new_record, data[2] end end This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,3 @@ class ExampleModel < ActiveRecord::Base include ActiveRecordMarshalable end