test_after_commit 0.2.7 → 0.3.0

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1c0c3b0770ff5057f0d9a1a4570396d7b1b6076c
4
- data.tar.gz: f1280a2c26b4e5f8dc4148542fb98ccf84b25733
3
+ metadata.gz: 56c217f295482402f1b0b61450c5688abbe5cdbb
4
+ data.tar.gz: 2089d55aa79c4110eafe4ce88d88b893bea0875a
5
5
  SHA512:
6
- metadata.gz: 1b567bd1c8174e1fda8848e5aef681a8e0fe1b6831ba4e5cb283019e8fae0c77c7ec7dca76d35ef39c0af2cbcd14f8e4c8271cf0a60b187a332b990601bfc8d0
7
- data.tar.gz: aa79a72bfb180a1f4acfabaddbebac954cacd497b134ca7fc830777a8fd2bd764715c2f3e27abe0112c19d1b14373c4484b121b0f22117b84ddf8b60f1cc5ccc
6
+ metadata.gz: 4647ddfa475ad62303dafa1a0d589ff454ce0c4db4188607fba5937b412775acfdae06167257cca2431556474715cedc22e62ce0a2b59272c662189a30bcd03f
7
+ data.tar.gz: 13b4ce6d63d923ce30c050c01ed43524aaf8685bfd95ce093af8b2ef669874948b28c54bc72dd060a121824b008df053efa76f03d199bde3faa0f7daf825b3f2
@@ -14,11 +14,14 @@ ActiveRecord::ConnectionAdapters::DatabaseStatements.class_eval do
14
14
  rolled_back = true
15
15
  raise e
16
16
  ensure
17
- if @test_open_transactions == 1 && !rolled_back
18
- test_commit_records
17
+ begin
18
+ if @test_open_transactions == 1 && !rolled_back
19
+ test_commit_records
20
+ end
21
+ ensure
22
+ @test_open_transactions -= 1
23
+ result
19
24
  end
20
- @test_open_transactions -= 1
21
- result
22
25
  end
23
26
  end
24
27
  end
@@ -29,9 +32,12 @@ ActiveRecord::ConnectionAdapters::DatabaseStatements.class_eval do
29
32
  commit_transaction_records(false)
30
33
  else
31
34
  transaction = @transaction || @transaction_manager.current_transaction
32
- transaction.commit_records
33
- transaction.records.clear # prevent duplicate .commit!
34
- transaction.instance_variable_get(:@state).set_state(nil)
35
+ begin
36
+ transaction.commit_records
37
+ ensure
38
+ transaction.records.clear # prevent duplicate .commit!
39
+ transaction.instance_variable_get(:@state).set_state(nil)
40
+ end
35
41
  end
36
42
  end
37
43
 
@@ -1,3 +1,3 @@
1
1
  module TestAfterCommit
2
- VERSION = '0.2.7'
2
+ VERSION = '0.3.0'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: test_after_commit
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.7
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-11 00:00:00.000000000 Z
11
+ date: 2014-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord