Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
cbfda9f
commit bea1d5e
Showing
3 changed files
with
51 additions
and
13 deletions.
There are no files selected for viewing
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
Version 2, December 2004 | ||
|
||
Copyright (C) 2004 Sam Hocevar | ||
14 rue de Plaisance, 75014 Paris, France | ||
Everyone is permitted to copy and distribute verbatim or modified | ||
copies of this license document, and changing it is allowed as long | ||
as the name is changed. | ||
|
||
DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | ||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION | ||
|
||
0. You just DO WHAT THE FUCK YOU WANT TO. | ||
|
This file contains 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 characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
Marshalize | ||
========== | ||
|
||
This Rails plugin provides serialization using Marshal in the same way Rails provides builtin serialization using YAML. In a model, just do | ||
class Robot < ActiveRecord::Base | ||
marshalize :features | ||
end | ||
and your app will automagically handle the `features` attribute using Marshal, dumping when saving to the database, loading when fetching from it. | ||
|
||
You can register any object. | ||
|
||
Example | ||
------- | ||
|
||
class Robot < ActiveRecord::Base | ||
marshalize :parameters # the "parameters" attribute will be saved as binary data | ||
marshalize :features, RobotFeature # you can define what kind of object is to be marshalized | ||
# an error will be raised if another class is provided for | ||
# this attribute | ||
serialize :status, Array # marshalization plays well with YAML classic serialization | ||
|
||
end | ||
|
||
TODO | ||
---- | ||
|
||
* super() stuff | ||
* manage blobs, not just text field (buffer limitations) | ||
|
||
|
||
License | ||
------- | ||
|
||
Released under the WTFPL (http://sam.zoy.org/wtfpl/COPYING) |