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: 45f6e32c50c40e3f4f86832d395a573b84f9baf6
4
- data.tar.gz: d6805cf8287cf7bd1b8b9620e5e98ac9c5452719
3
+ metadata.gz: e030f20f91266fb5acee28b6848ad9ff5d12711c
4
+ data.tar.gz: d0f912c5c1a086d723f0dcb48175387319afd7d0
5
5
  SHA512:
6
- metadata.gz: 528a667947df31e50d0ec01f4c5202e167080dae5e5fd736e37ba246d84f31822146bf7bdfce62c1a773d948bab4945c125d1754272a283167e1702a94b49ea7
7
- data.tar.gz: fbba59515aee66ca55e88326e17ecd11491698c60e7c2aed079245b2f12b8b31b781d93c42a5678352650d601d9ce409a2f92ab8ec53575ac114f3ad7ad8f3f2
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
- association_result = record.public_send(association)
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(@association).loaded?
40
+ record.association(association).loaded?
38
41
  end
39
42
  end
40
43
  end
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module ActiveRecordBatcher
3
- VERSION = "0.3.1"
3
+ VERSION = "0.3.2"
4
4
  end
5
5
  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.1
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-18 00:00:00.000000000 Z
11
+ date: 2017-02-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler