graphql-activerecord 0.4.2 → 0.4.3
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eb0a5e6a7aede364e37bcc2998d14080ae9f4eb4
|
4
|
+
data.tar.gz: a6d3c703939a2dab438abde64510c176d41504ce
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1b29432db0e4a92b1c286e59f8e447d6b01e20ac2969b1bbd117307cbe07dd2d7561ca99f4f7c076204c97d2b59dea3d0f7339f0fb71e34a4d30253442acfd47
|
7
|
+
data.tar.gz: 4eb8896e974750dcd1522b259e0ae885a67aece1a6aa3e17d2e4ae52457009d8d19276a2dbda0dee38acc0878e3c0dcc3d7206624f61816d009e0c1af5676b41
|
@@ -129,8 +129,9 @@ module GraphQL::Models
|
|
129
129
|
grouped_models.each do |key_attrs, vals|
|
130
130
|
child_model = vals[0]
|
131
131
|
|
132
|
-
inputs = grouped_inputs[key_attrs]
|
133
|
-
|
132
|
+
inputs = grouped_inputs[key_attrs]
|
133
|
+
inputs = inputs[0] if inputs
|
134
|
+
|
134
135
|
if inputs.nil?
|
135
136
|
child_model.mark_for_destruction
|
136
137
|
changes.push({ model_instance: child_model, action: :destroy })
|
@@ -32,7 +32,17 @@ module GraphQL::Models
|
|
32
32
|
|
33
33
|
def save!
|
34
34
|
fail StandardError.new("Need to call apply_changes before #{__method__}") unless @all_changes
|
35
|
-
changed_models.each
|
35
|
+
changed_models.each do |model|
|
36
|
+
next if model.destroyed?
|
37
|
+
|
38
|
+
if model.marked_for_destruction?
|
39
|
+
model.destroy
|
40
|
+
else
|
41
|
+
model.save!
|
42
|
+
end
|
43
|
+
end
|
44
|
+
|
45
|
+
changed_models.reject(&:destroyed?).each(&:reload)
|
36
46
|
end
|
37
47
|
end
|
38
48
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: graphql-activerecord
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Foster
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-05-
|
11
|
+
date: 2016-05-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|