simple-json-api-serializer 1.0.5 → 1.0.7

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
  SHA1:
3
- metadata.gz: ce688bde54e28bd747e9ec3c025f7cbc66351ae7
4
- data.tar.gz: d57ec8b80cfd6722118a472d8bb330dd4982649f
3
+ metadata.gz: 821d62d6fb8fc170488c258cc32f43d75333c107
4
+ data.tar.gz: af20d751fc245fd201c5f882ead61925fdbbb4ad
5
5
  SHA512:
6
- metadata.gz: e9a24c44feb5027c239f06549057dcaf9f7e280be51bf3631e2e0ca8345d73636185111b1f3317457ac6dfefddfbe536d9a6119011b1c5f7bfeed53b5f269b5d
7
- data.tar.gz: b1c4df35e938f57cba57d78d51612c78653538becb656ad7067554865e288bb12f0302efb9cfa2bf97bb1a9b3027253f9ca5138f0a83d2e7c8d64158c3ea2845
6
+ metadata.gz: fd0c24e1ab94a515ce779874191b3bb52898bf3d955e558dc2c4a3d82516fe8450676519ee9757de4df4a11ee8f6c71956ccf1063a7f0e84864d0b157992f4bf
7
+ data.tar.gz: cb2a8d03d0c07f8ed0c9486ba49cd9d524272c7bba489291c85aa74a2fa841ff4cd50e1eea83aa894f4b518759173f8ccd71da8d7932b5c4cd5fbe79cb1b8a26
@@ -28,7 +28,9 @@ module JSONApi
28
28
  data = data['data']
29
29
  name = sanitize_attribute_name(name)
30
30
 
31
- if data
31
+ if data.is_a? Array
32
+ attributes["#{name.singularize}_ids"] = data.map { |r| r.fetch('id') }
33
+ elsif data
32
34
  attributes["#{name}_id"] = data.fetch('id')
33
35
  attributes["#{name}_type"] = sanitize_type_name(data.fetch('type')).classify
34
36
  else
@@ -1,3 +1,3 @@
1
1
  module JSONApi
2
- VERSION = '1.0.5'
2
+ VERSION = '1.0.7'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-json-api-serializer
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marten Schilstra
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-05-02 00:00:00.000000000 Z
11
+ date: 2016-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport