wcc-contentful 0.2.0 → 0.2.1

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 00a9e00e55f441463939d98fd8b8542120976dc4
4
- data.tar.gz: 5eac07eb53c3e3a8b943c56c072c2f0cde90afe0
3
+ metadata.gz: bbf4090e5eb907ab57ae130ef528a05b48bedff6
4
+ data.tar.gz: 717ac008fd501476b14f7e638b12dbc3afa7f9a3
5
5
  SHA512:
6
- metadata.gz: a9bc2e68d9d4159a87284d8c90a7262539a057962682b605e608a602344e2d5aff2d3e1738961324175b93423c6fa82a221fca9b36277172d50c6a246e36eed9
7
- data.tar.gz: d5458f48090f6a234d035e6cd4b0887ffeab7024ebff4502a49559d0f98c9e5a969bbfc7516d4b61d6067e68f74ada91b9bd389393ebb3c36b2b12f921ed0dd0
6
+ metadata.gz: b5218be16ee83549e3dd3e876ce8be5d4ffee0ad0d33534eeaa2ef9679a4e2d973a78b242b192fac90d83836af35875a174896a578922f4ead213989dc9f68d8
7
+ data.tar.gz: a9673fbfa992ff680a49887a2aa4563adde136255476d1f160b9769ff5cb398ef304d7f86c851c0700d55c840a1f566e77d287b73eaee8ca4286b50f6a6dd163
@@ -58,7 +58,7 @@ module WCC::Contentful
58
58
  raise ArgumentError, "These fields do not exist: #{bad_fields}" unless bad_fields.empty?
59
59
 
60
60
  result = WCC::Contentful::Model.store.find_by(content_type: content_type, filter: filter)
61
- new(result, context)
61
+ new(result, context) if result
62
62
  end
63
63
 
64
64
  define_singleton_method(:inherited) do |subclass|
@@ -95,6 +95,9 @@ module WCC::Contentful
95
95
  when :Float
96
96
  raw_value = Float(raw_value)
97
97
  end
98
+ elsif f.array
99
+ # array fields need to resolve to an empty array when nothing is there
100
+ raw_value = []
98
101
  end
99
102
  instance_variable_set('@' + f.name, raw_value)
100
103
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module WCC
4
4
  module Contentful
5
- VERSION = '0.2.0'
5
+ VERSION = '0.2.1'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: wcc-contentful
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Watermark Dev