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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 07afefd2fe41039cb8c922578ba39e3aba41f5ec
4
- data.tar.gz: e269e8a82ad892be4e7f9081e30487301c20d30d
3
+ metadata.gz: f2ad0e1040698f179b39b373d7aa49c33dfb7b4d
4
+ data.tar.gz: ac1e411ed64f21568d6c1844e2ca454ea06c3c3f
5
5
  SHA512:
6
- metadata.gz: 2b79ebe7aa3d18209658d89042d8dfcc06d5a2a837688b57c9d3495b173aa50f65e6f35a0db0d4bb7c40b1fc0915db5b7733f016a4643e3b684b0878db9aac40
7
- data.tar.gz: e320d995609cb5a3064533b08b01cf86133a513932ce22bfdc5eeede5c64d2b2c0899fcab2907d10251927910bb4ffd780f641377e722056aff80bb7a616253a
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?(:each) ? primary : primary[0]
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!(include_keys)
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.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-02 00:00:00.000000000 Z
11
+ date: 2016-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake