wcc-contentful 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/wcc/contentful/model_builder.rb +4 -1
- data/lib/wcc/contentful/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: bbf4090e5eb907ab57ae130ef528a05b48bedff6
|
4
|
+
data.tar.gz: 717ac008fd501476b14f7e638b12dbc3afa7f9a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|