diff options
Diffstat (limited to 'app/serializers/hash_serializer.rb')
-rw-r--r-- | app/serializers/hash_serializer.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/app/serializers/hash_serializer.rb b/app/serializers/hash_serializer.rb new file mode 100644 index 0000000..5db639f --- /dev/null +++ b/app/serializers/hash_serializer.rb @@ -0,0 +1,9 @@ +class HashSerializer + def self.dump(hash) + hash.to_json + end + + def self.load(hash) + (hash || {}).with_indifferent_access + end +end |