test_after_commit 1.2.1 → 1.2.2

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
  SHA256:
3
- metadata.gz: 9e954a2092e6459d8aa847d25003d59a5e1e9585a49a1adac385bdfe53be73d7
4
- data.tar.gz: 8ba8118b026b6ef014ab6a4193b3f9a6929ec565bd6c6f6d84136eaea0cbf97a
3
+ metadata.gz: 9ba199df5f7861c050858a4c97ef739fd8e2d5c8425955be89ac189cbbc3dded
4
+ data.tar.gz: fd5998ae5a1032733da2951a501ef9a049f4060c3818370bc89b47cc0ded7d56
5
5
  SHA512:
6
- metadata.gz: 606b5057593a1299bfa01093635b6111b2eca9b1c58fe979caaac2492fc8ae4c2aa0dbe1cd2e3dd39c21f0bff13e4644d14d9aad48aa93e267a5e673b8bb5128
7
- data.tar.gz: 42502f70417505aba857cbe8fd8e175ec737bc6923ecfe65af8e8cc706ae526c3b5c316fce1d7483b7fd2f4942cfa83a9b99039349ab0f82804159b22385c3c2
6
+ metadata.gz: a7bcd2bfc6e37566ef925da38962d5951eb8fbc8e535e0392e132e7b947fa213c4267a80995e59c81c8978f82a63a5794cb1592bba28992488252aca33dba461
7
+ data.tar.gz: de0f8b1ebe5285939fceeb1240bf03dcee056c2a28871f9d7f4cb538014b726ebfad195696fe207ebc1789412a2ae5483845094b0cd033a14346b0bda563a456
@@ -4,6 +4,7 @@ module TestAfterCommit::DatabaseStatements
4
4
  skip_emulation = ActiveRecord::Base.connection.open_transactions.zero?
5
5
  run_callbacks = false
6
6
  result = nil
7
+ rolled_back = false
7
8
 
8
9
  super do
9
10
  begin
@@ -42,6 +43,9 @@ module TestAfterCommit::DatabaseStatements
42
43
  # This is because we're re-using the transaction on the stack, before
43
44
  # it's been popped off and re-created by the AR code.
44
45
  original = @transaction || @transaction_manager.current_transaction
46
+
47
+ return unless original.respond_to?(:records)
48
+
45
49
  transaction = original.dup
46
50
  transaction.instance_variable_set(:@records, transaction.records.dup) # deep clone of records array
47
51
  original.records.clear # so that this clear doesn't clear out both copies
@@ -1,3 +1,3 @@
1
1
  module TestAfterCommit
2
- VERSION = '1.2.1'
2
+ VERSION = '1.2.2'
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: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Grosser
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-11-13 00:00:00.000000000 Z
11
+ date: 2018-11-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord