graphql-activerecord 0.6.2 → 0.6.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/graphql/models/mutator.rb +12 -9
- data/lib/graphql/models/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2e9f35aa548f10556deb6481be1861a221b07c55
|
4
|
+
data.tar.gz: f98efc92a044fc51a2ed003b9f591870786373e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4b9a15fec449730050cb307f886a3c14c3d862d65caed881d385d7708a861e4272a957efa3a7905fce02d64da450489f59b03343d08710b36daaee05f9bed06f
|
7
|
+
data.tar.gz: b72ed02d3c119472a37a6e7f4fd27ea2499472a843460522d53d9f33a28348098e3e109f2fbb5c0e4c5b37957aaa0e30b105a7752fcc49b875bbe1ac18054bf9
|
@@ -32,17 +32,20 @@ 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
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
35
|
+
|
36
|
+
ActiveRecord::Base.transaction do
|
37
|
+
changed_models.each do |model|
|
38
|
+
next if model.destroyed?
|
39
|
+
|
40
|
+
if model.marked_for_destruction?
|
41
|
+
model.destroy
|
42
|
+
else
|
43
|
+
model.save!
|
44
|
+
end
|
42
45
|
end
|
43
|
-
end
|
44
46
|
|
45
|
-
|
47
|
+
changed_models.reject(&:destroyed?).each(&:reload)
|
48
|
+
end
|
46
49
|
end
|
47
50
|
end
|
48
51
|
|
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.6.
|
4
|
+
version: 0.6.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-06-
|
11
|
+
date: 2016-06-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: graphql
|