jsonapi-authorization 3.0.0 → 3.0.1

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
  SHA256:
3
- metadata.gz: 278b251b6f19d74827e485421e8df96e4d34cd374f95da17f1f51d0007e9326d
4
- data.tar.gz: d2416dc900f5303e36b6a1553b2e8833578e5313dbed6d6cf83c2bc810e6da1a
3
+ metadata.gz: 0f4f022931d8f0d2fac8b07f3eb24cc4d4769201ebdf75852a410d957ec7075e
4
+ data.tar.gz: eb467198ed058edd0e3d8ebcc7ba968b880a6db23c6493e3620df8936d58c0f1
5
5
  SHA512:
6
- metadata.gz: 01ae9ed91a1cb228137028c873a40a8456098ac63ab388c713b82472e182696554ede5ac0a7d364d6d45dba2231b5e19eae12f2df3836ca337523a50c2b307b9
7
- data.tar.gz: 3a496d6e621e3da23f0bc9a24ae704b850c5026782bc4cee65e9240d4e3fb252e91a79b9d0398814ac63edda66e83e22b828cd76327256f375f45303adc924e2
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
- else
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
  {
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
  module JSONAPI
3
3
  module Authorization
4
- VERSION = "3.0.0".freeze
4
+ VERSION = "3.0.1".freeze
5
5
  end
6
6
  end
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.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-28 00:00:00.000000000 Z
12
+ date: 2019-03-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-resources