jsonapi-realizer 6.0.0.rc2 → 6.0.0.rc3
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/jsonapi/realizer/resource.rb +12 -1
- data/lib/jsonapi/realizer/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: bc1f36e07f63f4db3623b9a732440558dc97bbf1091b8fe6d95c34c98d905eed
|
|
4
|
+
data.tar.gz: c17d349f785dfc541f1468ddbedc9bf993c5a225d8226a93ee331dd73a9ece0e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3741448af858c541febb41f22c1a58f4b07969a7ce67c9561012ed05a39e20d50b5f07632b190229c3683cddf90fa683dd4478c71a7679f95644fa92f810c90c
|
|
7
|
+
data.tar.gz: 470074d2d0abd25bb732ee6c625eab06da4aac877ffebf2e4c96e84c8c98632b1eb0dfcebe2750da64efd32e8117f1bb8b533949c66628c16989c6ab8e03007b
|
|
@@ -62,8 +62,11 @@ module JSONAPI
|
|
|
62
62
|
@scope = adapter.paginate(scope, *pagination)
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
if writing? && data?
|
|
65
|
+
if writing? && data? && attributes?
|
|
66
66
|
adapter.write_attributes(object, attributes)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
if writing? && data? && relationships?
|
|
67
70
|
adapter.write_relationships(object, relationships)
|
|
68
71
|
end
|
|
69
72
|
end
|
|
@@ -189,6 +192,10 @@ module JSONAPI
|
|
|
189
192
|
@type ||= data.fetch("type")
|
|
190
193
|
end
|
|
191
194
|
|
|
195
|
+
private def attributes?
|
|
196
|
+
data.key?("attributes")
|
|
197
|
+
end
|
|
198
|
+
|
|
192
199
|
def attributes
|
|
193
200
|
return unless data.key?("attributes")
|
|
194
201
|
|
|
@@ -198,6 +205,10 @@ module JSONAPI
|
|
|
198
205
|
transform_keys{|key| attribute(key).as}
|
|
199
206
|
end
|
|
200
207
|
|
|
208
|
+
private def relationships?
|
|
209
|
+
data.key?("relationships")
|
|
210
|
+
end
|
|
211
|
+
|
|
201
212
|
def relationships
|
|
202
213
|
return unless data.key?("relationships")
|
|
203
214
|
|