graphql_includable 0.2.5 → 0.2.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 68ed67aff6a6c72245d963362927b0b158365688
4
- data.tar.gz: 6b516166e7cb3ec68774b254fbcd0c9be873acc6
3
+ metadata.gz: 3c8f20574657c12b74d55fe9a06509381ff8f424
4
+ data.tar.gz: b4c9667c907560c8a3af23746272d76b81302930
5
5
  SHA512:
6
- metadata.gz: dc502e27199ca5db0f5a5e4d3880c1b91906ba5dd055a3532dd29098060f57dc06c88a27af7afcef9200ae3f6e03a3aa608c11fb6a29df652009b60ccf8a0fa4
7
- data.tar.gz: f9f6ca1b322ad37b6b81cdeae850f62223cf474ab29ee1090737cb11682a6309f99236490847dbdfebfe98e11f926a8edc995839154b0d3cb26acf7f997cbcdb
6
+ metadata.gz: edc374917c8ecd75456226683d042a1bd8e48ddc3fbc2f030b95f94d1a40d8af631155249faa4247c6547d72bc7f9f13b972c903dec6233e42260a7320dd37a4
7
+ data.tar.gz: 0374af5803f0ed1895f3304d2b86183185349b005caaab38de7020c910ef081de49ad499cc592c33d47f8a4be9bf7b061d7dffb05bcad5695b35d635a24b65fa
@@ -6,12 +6,12 @@ module GraphQLIncludable
6
6
  edge_class_name = join_chain.shift
7
7
  edge_class = str_to_class(edge_class_name)
8
8
 
9
- root_association_key = class_to_str(parent.class).to_sym
9
+ root_association_key = class_to_str(parent.class)
10
10
  unless edge_class.reflections.keys.include?(root_association_key)
11
11
  is_polymorphic = true
12
- root_association_key = edge_class.reflections.select { |k, r| r.polymorphic? }.keys.first.to_sym
12
+ root_association_key = edge_class.reflections.select { |k, r| r.polymorphic? }.keys.first
13
13
  end
14
- root_node = { root_association_key => [parent] }
14
+ root_node = { root_association_key.to_sym => [parent] }
15
15
  terminal_node = { class_to_str(node.class) => node }
16
16
  join_chain.reverse.each do |rel_name|
17
17
  terminal_node = { rel_name.to_s.pluralize => terminal_node }
@@ -20,7 +20,7 @@ module GraphQLIncludable
20
20
  search_hash = root_node.merge(terminal_node)
21
21
  edge_includes = join_chain.map { |s| s.to_s.singularize }
22
22
  edge_class = edge_class.includes(*edge_includes) unless edge_includes.empty?
23
- edge_class = edge_class.joins(root_association_key) unless is_polymorphic
23
+ edge_class = edge_class.joins(root_association_key.to_sym) unless is_polymorphic
24
24
  @edge ||= edge_class.find_by(search_hash)
25
25
  end
26
26
 
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.2.5
4
+ version: 0.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dan Rouse
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2018-05-07 00:00:00.000000000 Z
12
+ date: 2018-05-08 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description:
15
15
  email: