graphql-activerecord 0.5.5 → 0.5.6

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: 8e580775093b61f44e8c119e6cdba9c551877841
4
- data.tar.gz: 6d8dfe863f25e8345e1724fcdf636c8d3237712b
3
+ metadata.gz: daaabd69e2bf2900bf933c0925ac6b2372f2bd02
4
+ data.tar.gz: ccba786159faaad1cd884bf2ee72da23d47ad45f
5
5
  SHA512:
6
- metadata.gz: 20f0318b73f6a2ac455cbe6e00af3560920b2cbc68886d93ae4cf370dc10d6709388399cd63ec64858082b59f26aaae5011a0b9322c94c4d198b5d14f3e361ef
7
- data.tar.gz: 49d36558ff541fdf34b060e627d67bd9af2173c8e8597d4784477801819e70b0e8b5a1c492a3850da6e3d9e5bc36f518746661679cbe61235729ac05a4d82e0b
6
+ metadata.gz: 1a27c8559b95c44529659e156c99f39ef8e3e28a4816a9a05413a1ff19965a910277d257e52c371137a64214d6280bef1e2aa2993dd83024309c69d6a64b3a47
7
+ data.tar.gz: 0600db6e7d05dcf42f4e6e6b3fafd6a327296616a2e368a57c44499b053a4c005198acb5487da807c442294921b63460474e6c1f07016b4820185c5172d9e268
@@ -63,7 +63,16 @@ module GraphQL::Models
63
63
  return Array.wrap(field[:name]) if candidate_model == target_model
64
64
  end
65
65
 
66
- # Case 2: The input field is somewhere inside of a nested field map.
66
+ # Case 2: The input field *is* a nested map
67
+ candidate_maps = field_map.nested_maps.select { |m| m.association == attribute.to_s }
68
+
69
+ candidate_maps.each do |map|
70
+ # Walk to this field. If the model we get is the same as the target model, we found a match.
71
+ candidate_model = model_to_change(starting_model, map.path, [], create_if_missing: false)
72
+ return Array.wrap(map.name) if candidate_model == target_model
73
+ end
74
+
75
+ # Case 3: The input field is somewhere inside of a nested field map.
67
76
  field_map.nested_maps.each do |child_map|
68
77
  # If we don't have the values for this map, it can't be the right one.
69
78
  next if inputs[child_map.name].blank?
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Models
3
- VERSION = "0.5.5"
3
+ VERSION = "0.5.6"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: graphql-activerecord
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.5
4
+ version: 0.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ryan Foster