ocean-dynamo 0.1.7 → 0.1.8

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: 6cccffe0748dab25d6636c1c940957b312c8e9db
4
- data.tar.gz: 0c5c3f3fe8db490b4dd11eb9e1e4be9e918ce6b3
3
+ metadata.gz: b38443e8d58e7a350ed2964a808772e77ab0984e
4
+ data.tar.gz: 313186c1360ace3013305d4cb1917a0ccc384ac0
5
5
  SHA512:
6
- metadata.gz: 8386d62fef775426a6848cb108def59fc5ef372af6616bf024318f4ff39b3e1107a68dd4305a988625d7c8ba2de2bd44e2bbcc91d1d39ace9e31b1cf4084039d
7
- data.tar.gz: 2359b10215033cdafb147ac667eccc9a54f7a7b98c4e97e249a80e49af4cd6aeb187c5237a61dd6981ab2d67b72531856c116e3e907320763f41b376fd1806c3
6
+ metadata.gz: 1a4ecd0023e00b2f72b6bd369b59e97d3b63879ecfb81d89e03ed66b86d27602cdbb39e876802e355ff1ec04f2ca3ddc2aba3a1ecbb02803a047c2e035e272ee
7
+ data.tar.gz: 0ffa4e4ed49eb0f34f9986a8b0592979756653b5e82f4c5339d33ecc5cce37ede389f77abc370b87ca15b5ffede88a4d96408ab899f1c00055acc2840e75ce74
@@ -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
- return evaluate_default(default, type)
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"
@@ -1,3 +1,3 @@
1
1
  module OceanDynamo
2
- VERSION = "0.1.7"
2
+ VERSION = "0.1.8"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ocean-dynamo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson