jsonapi-renderer 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/jsonapi/renderer/document.rb +1 -1
- data/lib/jsonapi/renderer/resources_processor.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f2ad0e1040698f179b39b373d7aa49c33dfb7b4d
|
4
|
+
data.tar.gz: ac1e411ed64f21568d6c1844e2ca454ea06c3c3f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9c2d55ff1104119ece672fec2c54f6c5dafbc6e1633337540297c792de794630d59c398591fa8d8c2c47b4ce8b68dd286242143959666a8132253a5b5c7b0798
|
7
|
+
data.tar.gz: a6433aae68a2d73985a9ffff73fef853a6ede4bca8d614b8ba098bf54d3e8ba03c4692dbcedba8e6a400648b58ecf7411484ff4a890576e317f30a2a6d9178a7
|
@@ -38,7 +38,7 @@ module JSONAPI
|
|
38
38
|
primary, included =
|
39
39
|
ResourcesProcessor.new(Array(@data), @include, @fields).process
|
40
40
|
{}.tap do |hash|
|
41
|
-
hash[:data] = @data.respond_to?(:
|
41
|
+
hash[:data] = @data.respond_to?(:to_ary) ? primary : primary[0]
|
42
42
|
hash[:included] = included if included.any?
|
43
43
|
end
|
44
44
|
end
|
@@ -48,7 +48,7 @@ module JSONAPI
|
|
48
48
|
def traverse_resource(res, include_keys, primary)
|
49
49
|
ri = [res.jsonapi_type, res.jsonapi_id]
|
50
50
|
if @include_rels.include?(ri)
|
51
|
-
@include_rels[ri].merge
|
51
|
+
@include_rels[ri].merge(include_keys)
|
52
52
|
else
|
53
53
|
@include_rels[ri] = Set.new(include_keys)
|
54
54
|
(primary ? @primary : @included) << res
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: jsonapi-renderer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Lucas Hosseini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|