graphql-active_record_batcher 0.3.1 → 0.3.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e030f20f91266fb5acee28b6848ad9ff5d12711c
|
4
|
+
data.tar.gz: d0f912c5c1a086d723f0dcb48175387319afd7d0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f78fe70d16551a360a00737e88964f646dcd2e36df6cd25996ac9bf1cc0280e7fa1d332b2f459fa4e9cbc6445f890f9841255bdb158835836adb3e9b8cd52df3
|
7
|
+
data.tar.gz: cb3f6e78ca9f2076245a4682d48bc4820b8611b5c9a79b3dea8a317df6f6e5a9764da5dc1e6bd63d06329246466ec5f20cd7287ea042cfabb05fa6fa10ac4af6
|
@@ -24,8 +24,7 @@ module GraphQL
|
|
24
24
|
::ActiveRecord::Associations::Preloader.new.preload(records, association)
|
25
25
|
|
26
26
|
records.each do |record|
|
27
|
-
|
28
|
-
fulfill(record, association_result)
|
27
|
+
fulfill(record, read_association(record))
|
29
28
|
end
|
30
29
|
end
|
31
30
|
|
@@ -33,8 +32,12 @@ module GraphQL
|
|
33
32
|
|
34
33
|
attr_reader :model, :association
|
35
34
|
|
35
|
+
def read_association(record)
|
36
|
+
record.public_send(association)
|
37
|
+
end
|
38
|
+
|
36
39
|
def association_loaded?(record)
|
37
|
-
record.association(
|
40
|
+
record.association(association).loaded?
|
38
41
|
end
|
39
42
|
end
|
40
43
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-active_record_batcher
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Marc-Andre Giroux
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-02-
|
11
|
+
date: 2017-02-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|