graphql_lazy_load 0.3.0 → 0.3.1

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
  SHA256:
3
- metadata.gz: 30a2e056b22a38d09ee95c801c2b40b5ca5ca84b5fc6515dfa3561bf0e1457a8
4
- data.tar.gz: 6ab1efe390d966b27dabe05b813c6fb3efcab08456fdcd2a7f699477e05ed53b
3
+ metadata.gz: 9a1d247cda02efb8ff8695c9bd502ed4a8707c2f1419ffbb5be8502a59bfa842
4
+ data.tar.gz: 28fd830a789911d974ba640e2eae88074b90d3af19977271a47d4906cca342d0
5
5
  SHA512:
6
- metadata.gz: f1af93639f764829f3f7b452865e6e3e8a37bc3197ae0f367349aa71dec04fa939ef7f71c6b31c775f07226766cdc26e9a35bcac0abf06e4d9a44bad4392fb84
7
- data.tar.gz: 9d208fdccddd90fa56a273531f6d4c639eabf640ab8d84ab478f036cc84c69263f9ae6d69798c66812d67f7abdc2a4194d2c5e5a539fef861c183019677dee26
6
+ metadata.gz: 2fb82b1650aa1601cd65ac7d04b976558bba510cabeb9e62ce92df5b157bf27955a3080de6a92b991987237c6d0e5427ef6e28fd9c1667efbeed761a8db27903
7
+ data.tar.gz: 9d980b8155abed6d6d25bea9c20fe5e13a6095ef3a46c8fdcda4bbe9f8cb17f1ab9e337635d1d503e29fd228980d59ac02d39fa5c4ba412c3c8ff5457221fe68
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- graphql_lazy_load (0.3.0)
4
+ graphql_lazy_load (0.3.1)
5
5
  activerecord (>= 4.1.16)
6
6
  graphql (>= 1.3.0)
7
7
 
@@ -36,25 +36,25 @@ GEM
36
36
  ast (2.4.0)
37
37
  builder (3.2.3)
38
38
  concurrent-ruby (1.1.5)
39
- crass (1.0.4)
39
+ crass (1.0.6)
40
40
  erubi (1.8.0)
41
- graphql (1.9.12)
41
+ graphql (1.10.0)
42
42
  i18n (1.6.0)
43
43
  concurrent-ruby (~> 1.0)
44
44
  jaro_winkler (1.5.3)
45
- loofah (2.2.3)
45
+ loofah (2.4.0)
46
46
  crass (~> 1.0.2)
47
47
  nokogiri (>= 1.5.9)
48
48
  method_source (0.9.2)
49
49
  mini_portile2 (2.4.0)
50
50
  minitest (5.11.3)
51
- nokogiri (1.10.4)
51
+ nokogiri (1.10.7)
52
52
  mini_portile2 (~> 2.4.0)
53
53
  parallel (1.17.0)
54
54
  parser (2.6.3.0)
55
55
  ast (~> 2.4.0)
56
56
  psych (3.1.0)
57
- rack (2.0.7)
57
+ rack (2.0.8)
58
58
  rack-test (1.1.0)
59
59
  rack (>= 1.0, < 3)
60
60
  rails-dom-testing (2.0.3)
@@ -21,7 +21,14 @@ module GraphqlLazyLoad
21
21
  return if already_loaded_or_queued?
22
22
  # use copy of object so it doesnt add preload to associations.
23
23
  # this is so associations dont get loaded to object passed so different scopes get reloaded
24
- lazy_objects.add(object_class.new(type.object.attributes))
24
+ lazy_objects.add(
25
+ object_class.column_names.reduce(object_class.new) do |acc, column|
26
+ # only iterate over column in db so if select fields outside usual model
27
+ # values wont throw error
28
+ acc.send("#{column}=", type.object.send(column))
29
+ acc
30
+ end
31
+ )
25
32
  lazy_ids.add(object_id)
26
33
  end
27
34
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module GraphqlLazyLoad
4
- VERSION = "0.3.0"
4
+ VERSION = "0.3.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_lazy_load
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jonathon Gardner
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-09-17 00:00:00.000000000 Z
11
+ date: 2020-01-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -142,6 +142,7 @@ files:
142
142
  - bin/setup
143
143
  - gems/graphql_lazy_load-0.1.0.gem
144
144
  - gems/graphql_lazy_load-0.2.0.gem
145
+ - gems/graphql_lazy_load-0.3.0.gem
145
146
  - graphql_lazy_load.gemspec
146
147
  - lib/graphql_lazy_load.rb
147
148
  - lib/graphql_lazy_load/active_record_relation.rb