graphql-activerecord 0.5.5 → 0.5.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 +4 -4
- data/lib/graphql/models/mutation_helpers/validation.rb +10 -1
- data/lib/graphql/models/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: daaabd69e2bf2900bf933c0925ac6b2372f2bd02
|
4
|
+
data.tar.gz: ccba786159faaad1cd884bf2ee72da23d47ad45f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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?
|