jsonapi.rb 1.2.0 → 1.2.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
  SHA1:
3
- metadata.gz: 7b246a81ea3e2cbc309f751a2c618e2bfc898a74
4
- data.tar.gz: c3096701eecc967d3c125668d977baaf92fc8b40
3
+ metadata.gz: 33681c6b51c54e27169bfef6b0d9185e1fb80b95
4
+ data.tar.gz: 4fabb406e5d206e9c42896c6e58a5e77372a68a7
5
5
  SHA512:
6
- metadata.gz: be7de562824d255df5ff03d6bee8dc7b9e4f89f6a6fb5c0bee0cbf149f15716ae3ad17225db0262021f9d43c512a89d4e60b6880d8390e897e4f1e7305daf41a
7
- data.tar.gz: f227a7b8891cc6389682ed3ef478f229d8ba8375f206403e22b49fb596f3fb7e9da22d57cdf3f8a3dc8daf92706a5f7454e12cb115d04ab3c130b907920b4c29
6
+ metadata.gz: ae9a1760b380ef3ff3ebb6b050cdb29b7e59e1032ad21d61f26bb97a357b873590f9fa12fca544cd7074ee04fab2d6ea40b86d7eccaa5832bd6ad334eacbe212
7
+ data.tar.gz: d55f34067318a8fb16a841cf742b5e9180c306ca54e48f7f69461db45ad1d0df621f93c41d36727d644e38262973e420aad2253a132dee22295dd4a43ac0c4b0
data/Gemfile.lock CHANGED
@@ -8,7 +8,7 @@ GIT
8
8
  PATH
9
9
  remote: .
10
10
  specs:
11
- jsonapi.rb (1.2.0)
11
+ jsonapi.rb (1.2.1)
12
12
  fast_jsonapi (~> 1.5)
13
13
  rack
14
14
  ransack
@@ -37,10 +37,12 @@ module JSONAPI
37
37
  attribute :source do |object, params|
38
38
  error_key, _ = object
39
39
  model_serializer = params[:model_serializer]
40
+ attrs = (model_serializer.attributes_to_serialize || {}).keys
41
+ rels = (model_serializer.relationships_to_serialize || {}).keys
40
42
 
41
- if model_serializer.attributes_to_serialize.keys.include?(error_key)
43
+ if attrs.include?(error_key)
42
44
  { pointer: "/data/attributes/#{error_key}" }
43
- elsif model_serializer.relationships_to_serialize.keys.include?(error_key)
45
+ elsif rels.include?(error_key)
44
46
  { pointer: "/data/relationships/#{error_key}" }
45
47
  else
46
48
  { pointer: '' }
@@ -1,3 +1,3 @@
1
1
  module JSONAPI
2
- VERSION = '1.2.0'
2
+ VERSION = '1.2.1'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi.rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stas Suscov