jsonapi-authorization 3.0.0 → 3.0.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
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 0f4f022931d8f0d2fac8b07f3eb24cc4d4769201ebdf75852a410d957ec7075e
|
|
4
|
+
data.tar.gz: eb467198ed058edd0e3d8ebcc7ba968b880a6db23c6493e3620df8936d58c0f1
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 2a2ba3ebb1131224e71f80812e78d5b2cef813d3369f4d7179967dd10a28dd83e546935ed79e1f79ebdeaf522c81b38a181ac7523d6b71acbda2b8e8ecacc6a4
|
|
7
|
+
data.tar.gz: e9afd3ba287bfcc9ef1ad8e67eb23ca79f9b0bab3b87a61c8984aa74516c2d194361a12410978ec04bd7995b0a463ea2ad304ab31612aced9ddfcf75b40a5b99
|
|
@@ -315,7 +315,7 @@ module JSONAPI
|
|
|
315
315
|
when Hash # polymorphic relationship
|
|
316
316
|
resource_class = @resource_klass.resource_for(assoc_value[:type].to_s)
|
|
317
317
|
resource_class.find_by_key(assoc_value[:id], context: context)._model
|
|
318
|
-
|
|
318
|
+
when Array
|
|
319
319
|
resource_class = resource_class_for_relationship(assoc_name)
|
|
320
320
|
resources = resource_class.find_by_keys(assoc_value, context: context)
|
|
321
321
|
resources.map(&:_model).tap do |scoped_records|
|
|
@@ -324,6 +324,9 @@ module JSONAPI
|
|
|
324
324
|
fail JSONAPI::Exceptions::RecordNotFound, related_ids
|
|
325
325
|
end
|
|
326
326
|
end
|
|
327
|
+
else
|
|
328
|
+
resource_class = resource_class_for_relationship(assoc_name)
|
|
329
|
+
resource_class.find_by_key(assoc_value, context: context)._model
|
|
327
330
|
end
|
|
328
331
|
|
|
329
332
|
{
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: jsonapi-authorization
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 3.0.
|
|
4
|
+
version: 3.0.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vesa Laakso
|
|
@@ -9,7 +9,7 @@ authors:
|
|
|
9
9
|
autorequire:
|
|
10
10
|
bindir: bin
|
|
11
11
|
cert_chain: []
|
|
12
|
-
date: 2019-03-
|
|
12
|
+
date: 2019-03-29 00:00:00.000000000 Z
|
|
13
13
|
dependencies:
|
|
14
14
|
- !ruby/object:Gem::Dependency
|
|
15
15
|
name: jsonapi-resources
|