ocean-dynamo 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/ocean-dynamo/dynamo.rb +3 -3
- data/lib/ocean-dynamo/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6cccffe0748dab25d6636c1c940957b312c8e9db
|
4
|
+
data.tar.gz: 0c5c3f3fe8db490b4dd11eb9e1e4be9e918ce6b3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8386d62fef775426a6848cb108def59fc5ef372af6616bf024318f4ff39b3e1107a68dd4305a988625d7c8ba2de2bd44e2bbcc91d1d39ace9e31b1cf4084039d
|
7
|
+
data.tar.gz: 2359b10215033cdafb147ac667eccc9a54f7a7b98c4e97e249a80e49af4cd6aeb187c5237a61dd6981ab2d67b72531856c116e3e907320763f41b376fd1806c3
|
data/lib/ocean-dynamo/dynamo.rb
CHANGED
@@ -342,7 +342,7 @@ module OceanDynamo
|
|
342
342
|
return nil if value == nil
|
343
343
|
case type
|
344
344
|
when :string
|
345
|
-
|
345
|
+
["", []].include?(value) ? nil : value
|
346
346
|
when :integer
|
347
347
|
value
|
348
348
|
when :float
|
@@ -378,7 +378,7 @@ module OceanDynamo
|
|
378
378
|
case type
|
379
379
|
when :string
|
380
380
|
return "" if value == nil
|
381
|
-
value
|
381
|
+
value.is_a?(Set) ? value.to_a : value
|
382
382
|
when :integer
|
383
383
|
return nil if value == nil
|
384
384
|
value.is_a?(Array) ? value.collect(&:to_i) : value.to_i
|
@@ -540,7 +540,7 @@ module OceanDynamo
|
|
540
540
|
def evaluate_default(default, type)
|
541
541
|
return default.call if default.is_a?(Proc)
|
542
542
|
return "" if default == nil && type == :string
|
543
|
-
return default.clone if default.is_a?(Array) || default.is_a?(String) # Instances need their own
|
543
|
+
return default.clone if default.is_a?(Array) || default.is_a?(String) # Instances need their own copies
|
544
544
|
default
|
545
545
|
end
|
546
546
|
|
data/lib/ocean-dynamo/version.rb
CHANGED