jsonapi_compliable 0.11.2 → 0.11.3

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: 6db73195ae7cc73877b7d3bf32fa81bb89f0e747
4
- data.tar.gz: 186d279c3221ab57bf08ab86145bac235c621c17
3
+ metadata.gz: f09a3b7abaad7968009175f50671ba51a32e42c0
4
+ data.tar.gz: d0a5de6083ae24be24380ff620fb10aa8ce0e3d6
5
5
  SHA512:
6
- metadata.gz: df42aaa0b32e2fdb0aa6c1dd288fb93765e8d52bc48ba676751c280c96b1a6ee81348ec75bad9a2b08cd9e02e73e6905c10057ba8c69634cc2e39d788d68a0d4
7
- data.tar.gz: d60190e16b515697be4b6167034815d1f265c753cb7e2bf57c9345f2a1d592b83f1a1b2cc9289750a6008f01be6daed66d8147047caaed09c4bf99894aa03b30
6
+ metadata.gz: 0aa3c2b725818ef5ef30e328a98dc1595ffdace212cf7addf5c15db2b19e4f5ee48f17cde4b26358ee0a4ab42a94e29d5bda032c4e58ffbad367610135298268
7
+ data.tar.gz: 9f0469e4fb7ff9b697729e02a5d616a6551beb3d55374fa6eeb6ba645a7a22e431f9651cb708f63adae0c3a8d2f6a8fb20b80bda83549ca780c761a7e9de78b4
@@ -76,7 +76,11 @@ 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 }).distinct
79
+ _scope.call
80
+ .joins(through)
81
+ .preload(through) # otherwise n+1 as we reference in #assign
82
+ .where(through => { fk => parent_ids })
83
+ .distinct
80
84
  end
81
85
 
82
86
  assign do |parents, children|
@@ -1,3 +1,3 @@
1
1
  module JsonapiCompliable
2
- VERSION = "0.11.2"
2
+ VERSION = "0.11.3"
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.11.2
4
+ version: 0.11.3
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: 2018-03-05 00:00:00.000000000 Z
12
+ date: 2018-04-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-serializable