graphql_includable 0.1.3 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/graphql_includable.rb +3 -10
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 71f63a92656363034ac25b4ca3d74b73d3eeacc8
4
- data.tar.gz: fbaf39008e49807c40d5e52c098ecc5c24805c87
3
+ metadata.gz: 422e58558f8fad15867c7e3310cb466d1da7ad87
4
+ data.tar.gz: d6872a079bc7fd67b241736ef7214a2f1aefe806
5
5
  SHA512:
6
- metadata.gz: 20898d3e9fe3ac991bf7ff93262e6f071f02aa6982bae48d0a7f73eebf1b16c89a2825348612ed6a319228e685df84696fe18f129eb85674704f8865faf0afc0
7
- data.tar.gz: 098ef2c5f17a804c0b1602ad8d7e7a80ef949e6036ac01fa15b2cb88fd0f3539765d61a02d1e0a8babce862e72448c6e9181b036a3f2d9e2581813ad7c8116a1
6
+ metadata.gz: 0e27a2d8c049be3eda8248860aecc254e67944c908a32c5b06a9af5ceb7f4f748495620b9dee6725f9be5b04bfcb34e677625a1c935f59258fb30907e19e7680
7
+ data.tar.gz: 509fdbaa84c06ce4e4bc8ccff1d653e53fc09f7b8fd82cb12b060d1d6b9a7ecf69a221d6f5d43c3d979e5cb0fdfb3d75e25dba9cb89c203b7fa31ee3dc17c4d2
@@ -64,18 +64,11 @@ module GraphQLIncludable
64
64
 
65
65
  if association
66
66
  child_includes = includes_from_irep_node(child_node)
67
-
68
67
  if node_has_active_record_children(child_node) && child_includes.size > 0
69
- if delegated_model_name
70
- nested_includes[delegated_model_name] = {}
71
- nested_includes[delegated_model_name][raw_association_name] = child_includes
72
- else
73
- nested_includes[association_name] = child_includes
74
- end
75
- elsif specified_includes
76
- includes << specified_includes
68
+ child_key = delegated_model_name || association_name
69
+ nested_includes[child_key] = wrap_delegate(child_includes, delegated_model_name, raw_association_name)
77
70
  else
78
- includes << association_name
71
+ includes << wrap_delegate(specified_includes || association_name, delegated_model_name)
79
72
  end
80
73
  elsif specified_includes
81
74
  includes << specified_includes
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql_includable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Rouse
@@ -40,7 +40,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
40
40
  version: '0'
41
41
  requirements: []
42
42
  rubyforge_project:
43
- rubygems_version: 2.6.10
43
+ rubygems_version: 2.6.12
44
44
  signing_key:
45
45
  specification_version: 4
46
46
  summary: An ActiveSupport::Concern for GraphQL Ruby to eager-load query data