toy-dynamo 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f12795e1156d00c91369903150e12b7ed192a7b6
|
4
|
+
data.tar.gz: 32b4a40ee6afd98ca49a9cab1a694588dda4d7a0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 954d17ee74c141e6d6268ab404e133178b9333675015fa4c4c5a356e16ddc863c06fcea8d40e8e3dc8cab53118f6783fecc255a83c59a58701a0994be743e470
|
7
|
+
data.tar.gz: 31950ddcecdce9ee4a089d09053827f98a63ebcc944add40633237cc017de381d86b25ac7395895665e229709123a672d15294806804fbe601bcc0361d485fdb
|
@@ -2,11 +2,18 @@ module Toy
|
|
2
2
|
module Extensions
|
3
3
|
module Hash
|
4
4
|
def to_store(value, *)
|
5
|
-
Marshal.dump(value)
|
5
|
+
AWS::DynamoDB::Binary.new(Marshal.dump(value))
|
6
6
|
end
|
7
7
|
|
8
8
|
def from_store(value, *)
|
9
|
-
|
9
|
+
#begin
|
10
|
+
value.nil? ? store_default : (value.class.is_a?(Hash) ? value : Marshal.load(value))
|
11
|
+
#rescue ArgumentError => e
|
12
|
+
#if e.message =~ /dump format error/
|
13
|
+
#Toy::Dynamo::Config.logger.error "Could not unmarshal data!\n\t#{value.inspect}"
|
14
|
+
#store_default
|
15
|
+
#end
|
16
|
+
#end
|
10
17
|
end
|
11
18
|
end
|
12
19
|
end
|
data/lib/toy/dynamo/version.rb
CHANGED