jsonapi_compliable 0.7.4 → 0.7.5

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: b4824fc1b2bdda9663ce448f1625067b7a13a5eb
4
- data.tar.gz: a9899e4acc340f754b8572439f2d2557f6e17318
3
+ metadata.gz: 52e6a7995d336578ca203daba3bfc589ab698bb6
4
+ data.tar.gz: 6b0e1ce3de7b1efe8244082cfff43555342db8be
5
5
  SHA512:
6
- metadata.gz: 2f09e4b11092e568eca6564ffcfff9a0532be6b9ce2ad56bc414c0333aadcb2011e7f854828c29568508afdb2efce6ac43fc57dd9e4e7045a4bc57739ea102cd
7
- data.tar.gz: a75fa2b148bf3d20638ce829f6b53bb2329990432e2684fac8f9ba8ba0e628ae0e83bd0fc5dd363cc554e6d04be9d21560bb73faa36cdb0be6b282e678b38f2e
6
+ metadata.gz: 25f14cc6324bc5bdc7142ffb87a2753c662663496f57870192ca0b390a6cee968410e0c6bb5ed96c08aad802e481f355bcc83f0cd0a30dbab95f023d83732e99
7
+ data.tar.gz: 915dee64a3968483f19c63afbc8e8d055be6b6c4d2e74df09dbb0ea3b08bd537da365a6094b42a5349d7dffb7a90a2a45a89c5988d003d943cf54c3e56df121d
@@ -2,7 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- gem "rails", ['>= 5.0', '< 5.1']
5
+ gem "rails", "~> 5.0"
6
6
  gem "jsonapi-rails", "~> 0.1.0", :require => "jsonapi/rails"
7
7
  gem "rspec-rails"
8
8
 
@@ -76,7 +76,7 @@ module JsonapiCompliable
76
76
  parent_ids = parents.map { |p| p.send(primary_key) }
77
77
  parent_ids.uniq!
78
78
  parent_ids.compact!
79
- _scope.call.joins(through).where(through => { fk => parent_ids })
79
+ _scope.call.joins(through).where(through => { fk => parent_ids }).distinct
80
80
  end
81
81
 
82
82
  assign do |parents, children|
@@ -310,7 +310,10 @@ module JsonapiCompliable
310
310
  # @return [Hash] The nested include hash
311
311
  # @api private
312
312
  def to_hash(processed = [])
313
- return { name => {} } if processed.include?(self)
313
+ # Cut off at 5 recursions
314
+ if processed.select { |p| p == self }.length == 5
315
+ return { name => {} }
316
+ end
314
317
  processed << self
315
318
 
316
319
  result = { name => {} }.tap do |hash|
@@ -1,3 +1,3 @@
1
1
  module JsonapiCompliable
2
- VERSION = "0.7.4"
2
+ VERSION = "0.7.5"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: jsonapi_compliable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.4
4
+ version: 0.7.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Lee Richmond
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2017-07-20 00:00:00.000000000 Z
12
+ date: 2017-08-09 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-serializable