test_after_commit 1.2.1 → 1.2.2
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 +4 -4
- data/lib/test_after_commit/database_statements.rb +4 -0
- data/lib/test_after_commit/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9ba199df5f7861c050858a4c97ef739fd8e2d5c8425955be89ac189cbbc3dded
|
4
|
+
data.tar.gz: fd5998ae5a1032733da2951a501ef9a049f4060c3818370bc89b47cc0ded7d56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
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.
|
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-
|
11
|
+
date: 2018-11-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|