jsonapi_compliable 0.11.19 → 0.11.20

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: 730c7a3f80de405da0e12effab27f2d45adbd0aa
4
- data.tar.gz: cdebd6cc0bef0354564ecc86155bfa12aeb5f87b
3
+ metadata.gz: 30a09fe20f0f51315ddb1b52f0c050ddb5cc4a11
4
+ data.tar.gz: 5b5a8516804383590b1500ac1ba877bb634d6152
5
5
  SHA512:
6
- metadata.gz: a784b63862268fe51e7bafbf60a3b4595507324684b002f00d0c523fb384485f799bbade81131ec6835bfd853e312a7150be00b100ec12e317b1532948f044c8
7
- data.tar.gz: 360588f9e09943c2647b7d27173db29e657f2e33aab19a8900b44b87fb5d543c734676b8be9aaa3a10a39fd6870145b98487dbc7da7f74d014677899563fedf2
6
+ metadata.gz: c5434f22ea4634aec057f2f20ae551395999bc5b6700487feea5e97a159c30bd329c2d5e88f8421cb6432eddc7705986016d098fb0db4d08ef9f129e77a05d11
7
+ data.tar.gz: 96c35a20caa936b37a8d5b731aa0dd2ae50cc23e65a5af3ae033b7f36d13b26f8ffd2cc87fc3e2e95c53bd2803bc4296348d2dfaa99733bc2cc9bec9f6512c9a
@@ -94,10 +94,14 @@ module JsonapiCompliable
94
94
  parent_ids = parents.map { |p| p.send(primary_key) }
95
95
  parent_ids.uniq!
96
96
  parent_ids.compact!
97
+
98
+ table_name = parents[0]
99
+ .class.reflections[through.to_s].klass.table_name
100
+
97
101
  _scope.call
98
102
  .joins(through)
99
103
  .preload(through) # otherwise n+1 as we reference in #assign
100
- .where(through => { fk => parent_ids })
104
+ .where(table_name => { fk => parent_ids })
101
105
  .distinct
102
106
  end
103
107
 
@@ -1,3 +1,3 @@
1
1
  module JsonapiCompliable
2
- VERSION = "0.11.19"
2
+ VERSION = "0.11.20"
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.19
4
+ version: 0.11.20
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-06-06 00:00:00.000000000 Z
12
+ date: 2018-06-11 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: jsonapi-serializable