after_transaction_commit 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -1
- data/README.md +2 -2
- data/lib/after_transaction_commit/transaction.rb +10 -3
- data/lib/after_transaction_commit/version.rb +1 -1
- data/spec/gemfiles/61.gemfile +5 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '04185ece40a9ad439cf8a540b8728f7e9819b4512b1260f2e6b9dd7947570986'
|
4
|
+
data.tar.gz: b0394200049e17c6818818ae0b2cd8c53e842c2298b825b8b6a23a4e7489a666
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d36862aa6c26a4d2d5e01eeaa763915ad852e1d5d5514e0a2d11d44ef5607ec7164f974192d68d7cb2ddc4c58f942e68011ed4fc12f1e5484c884845e4207f59
|
7
|
+
data.tar.gz: 8ad0470cca519558e6c825e586898f596908647f9168daf2b499140e1f75c3dbbe592f0a9a8f1ee354a7b11f4a419feca3dfa96aab4ba1f2e97ff314ba313e21
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -35,13 +35,13 @@ Or install it yourself as:
|
|
35
35
|
|
36
36
|
```ruby
|
37
37
|
ActiveRecord::Base.transaction do
|
38
|
-
ActiveRecord::Base.after_transaction_commit { run_some_background_job }
|
38
|
+
ActiveRecord::Base.connection.after_transaction_commit { run_some_background_job }
|
39
39
|
# run_some_background_job has not run yet
|
40
40
|
end
|
41
41
|
# now, it has run
|
42
42
|
|
43
43
|
# this one runs immediately, since we are outside a transaction
|
44
|
-
ActiveRecord::Base.after_transaction_commit { some_other_task }
|
44
|
+
ActiveRecord::Base.connection.after_transaction_commit { some_other_task }
|
45
45
|
```
|
46
46
|
|
47
47
|
### Usage in Tests
|
@@ -1,8 +1,15 @@
|
|
1
1
|
module AfterTransactionCommit
|
2
2
|
module Transaction
|
3
|
-
|
4
|
-
|
5
|
-
|
3
|
+
if ::ActiveRecord.version >= Gem::Version.new("6.1")
|
4
|
+
def initialize(connection, **options)
|
5
|
+
super
|
6
|
+
@after_commit_blocks = []
|
7
|
+
end
|
8
|
+
else
|
9
|
+
def initialize(connection, options, run_commit_callbacks: false)
|
10
|
+
super
|
11
|
+
@after_commit_blocks = []
|
12
|
+
end
|
6
13
|
end
|
7
14
|
|
8
15
|
def add_after_commit(block)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: after_transaction_commit
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.2.
|
4
|
+
version: 2.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brian Palmer
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -152,6 +152,7 @@ files:
|
|
152
152
|
- spec/database.rb
|
153
153
|
- spec/gemfiles/52.gemfile
|
154
154
|
- spec/gemfiles/60.gemfile
|
155
|
+
- spec/gemfiles/61.gemfile
|
155
156
|
- spec/spec_helper.rb
|
156
157
|
homepage: https://github.com/instructure/after_transaction_commit
|
157
158
|
licenses:
|
@@ -181,4 +182,5 @@ test_files:
|
|
181
182
|
- spec/database.rb
|
182
183
|
- spec/gemfiles/52.gemfile
|
183
184
|
- spec/gemfiles/60.gemfile
|
185
|
+
- spec/gemfiles/61.gemfile
|
184
186
|
- spec/spec_helper.rb
|