Created
July 28, 2015 21:58
-
-
Save smathy/1f8ffb39b8ac0d1f900d to your computer and use it in GitHub Desktop.
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
class Foo < ActiveRecord::Base | |
class MyOwnHash | |
def self.dump(hash) | |
hash.to_json | |
end | |
def self.load(hash) | |
(hash || {}).with_indifferent_access | |
end | |
end | |
serialize :stuff, MyOwnHash | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment