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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbefcc53e87e244a7244d23d78409e16fbec44e4
4
- data.tar.gz: f566c6909cc03a8e6a7a3aa19620a35951f6eb8b
3
+ metadata.gz: 2e9f35aa548f10556deb6481be1861a221b07c55
4
+ data.tar.gz: f98efc92a044fc51a2ed003b9f591870786373e6
5
5
  SHA512:
6
- metadata.gz: 9517d487ec69c2d4f505dba3dc9c686e9ee33de6e1fffa463eebd86f1aeb8d34f947603b0dacd5198925c18ed0320f35cd655d36de283dafa3f24bba53a19efc
7
- data.tar.gz: 65ea1b55f1a0d6afa022ac9e1682254e9c9bc65a53a28879e709523af734fc1b83becf2885672b4e0f339263992e59b0be5b2593284c4c87eb0ded3bdc750d54
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
- 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!
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
- changed_models.reject(&:destroyed?).each(&:reload)
47
+ changed_models.reject(&:destroyed?).each(&:reload)
48
+ end
46
49
  end
47
50
  end
48
51
 
@@ -1,5 +1,5 @@
1
1
  module GraphQL
2
2
  module Models
3
- VERSION = "0.6.2"
3
+ VERSION = "0.6.3"
4
4
  end
5
5
  end
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.2
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-08 00:00:00.000000000 Z
11
+ date: 2016-06-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: graphql