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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ab7ec0ce7942ae65adf02210e960a9d2a9dad65c
4
- data.tar.gz: 23704b711a3aa737ef79b72fe18883e6fe191290
3
+ metadata.gz: 6cccffe0748dab25d6636c1c940957b312c8e9db
4
+ data.tar.gz: 0c5c3f3fe8db490b4dd11eb9e1e4be9e918ce6b3
5
5
  SHA512:
6
- metadata.gz: daa6b4a93f93fc71e58309f321bbdf45a7e7220454ec6da2ee11995f7325385932132421e1d8221575f011e7a15db426d66e6abaa8fe0f4cb0970e4e06f9a9be
7
- data.tar.gz: 088418b2f09bf3035a46d622c9b070c4759985c7aa40bb4a6d6a01e0ae0cc40735b30d9734957c8f6eb97215115b1d0f7e662c1bbd0b84fdc308675ad5630808
6
+ metadata.gz: 8386d62fef775426a6848cb108def59fc5ef372af6616bf024318f4ff39b3e1107a68dd4305a988625d7c8ba2de2bd44e2bbcc91d1d39ace9e31b1cf4084039d
7
+ data.tar.gz: 2359b10215033cdafb147ac667eccc9a54f7a7b98c4e97e249a80e49af4cd6aeb187c5237a61dd6981ab2d67b72531856c116e3e907320763f41b376fd1806c3
@@ -342,7 +342,7 @@ module OceanDynamo
342
342
  return nil if value == nil
343
343
  case type
344
344
  when :string
345
- value == "" ? nil : value
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 copy
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
 
@@ -1,3 +1,3 @@
1
1
  module OceanDynamo
2
- VERSION = "0.1.6"
2
+ VERSION = "0.1.7"
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.6
4
+ version: 0.1.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Peter Bengtson