ocean-dynamo 0.1.7 → 0.1.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/ocean-dynamo/dynamo.rb +7 -7
- 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: b38443e8d58e7a350ed2964a808772e77ab0984e
|
4
|
+
data.tar.gz: 313186c1360ace3013305d4cb1917a0ccc384ac0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1a4ecd0023e00b2f72b6bd369b59e97d3b63879ecfb81d89e03ed66b86d27602cdbb39e876802e355ff1ec04f2ca3ddc2aba3a1ecbb02803a047c2e035e272ee
|
7
|
+
data.tar.gz: 0ffa4e4ed49eb0f34f9986a8b0592979756653b5e82f4c5339d33ecc5cce37ede389f77abc370b87ca15b5ffede88a4d96408ab899f1c00055acc2840e75ce74
|
data/lib/ocean-dynamo/dynamo.rb
CHANGED
@@ -344,9 +344,9 @@ module OceanDynamo
|
|
344
344
|
when :string
|
345
345
|
["", []].include?(value) ? nil : value
|
346
346
|
when :integer
|
347
|
-
value
|
347
|
+
value == [] ? nil : value
|
348
348
|
when :float
|
349
|
-
value
|
349
|
+
value == [] ? nil : value
|
350
350
|
when :boolean
|
351
351
|
value ? "true" : "false"
|
352
352
|
when :datetime
|
@@ -372,19 +372,19 @@ module OceanDynamo
|
|
372
372
|
def deserialize_attribute(value, metadata,
|
373
373
|
type: metadata[:type],
|
374
374
|
default: metadata[:default])
|
375
|
-
if value == nil && type != :string
|
376
|
-
|
377
|
-
end
|
375
|
+
# if value == nil && type != :string
|
376
|
+
# return evaluate_default(default, type)
|
377
|
+
# end
|
378
378
|
case type
|
379
379
|
when :string
|
380
380
|
return "" if value == nil
|
381
381
|
value.is_a?(Set) ? value.to_a : value
|
382
382
|
when :integer
|
383
383
|
return nil if value == nil
|
384
|
-
value.is_a?(Array) ? value.collect(&:to_i) : value.to_i
|
384
|
+
value.is_a?(Set) || value.is_a?(Array) ? value.collect(&:to_i) : value.to_i
|
385
385
|
when :float
|
386
386
|
return nil if value == nil
|
387
|
-
value.is_a?(Array) ? value.collect(&:to_f) : value.to_f
|
387
|
+
value.is_a?(Set) || value.is_a?(Array) ? value.collect(&:to_f) : value.to_f
|
388
388
|
when :boolean
|
389
389
|
case value
|
390
390
|
when "true"
|
data/lib/ocean-dynamo/version.rb
CHANGED