ar_after_transaction 0.7.0 → 0.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Readme.md +5 -4
- data/lib/ar_after_transaction/version.rb +2 -1
- data/lib/ar_after_transaction.rb +4 -6
- metadata +8 -8
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0cc72b7f26b842b9adfedb004133d2cc0748e0783b0fdfeb0aebe9e4c52f8b3a
|
4
|
+
data.tar.gz: c61ca0e181cc2a4eaacdb45b63aab20dc77bd7af72dcb066735adce2f989944b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a5402cb5c03bbf9d67a8a2da4e30dde24c191e8ec403a8f4a0084d95a5d6d46f9d658cf3903f21f2947e51113df2a13eae51393bf6e8a9730e3bd8126a93cabc
|
7
|
+
data.tar.gz: 4e6556949152666f978bf152ac5c4c830dfbbaa4cb3a36da6004a4ec8a2273a989476116377ec81c3f58e4710265da911eaf2debf5565ca21718c6443c3904ca
|
data/Readme.md
CHANGED
@@ -54,11 +54,12 @@ after_transaction will perform the given block immediately
|
|
54
54
|
after_transaction assumes zero open transactions.<br/>
|
55
55
|
If you use transactional fixtures you should change it in test mode.
|
56
56
|
|
57
|
+
`Rspec:`
|
57
58
|
```ruby
|
58
|
-
#
|
59
|
-
config.
|
60
|
-
|
61
|
-
end
|
59
|
+
# spec/rails_helper.rb
|
60
|
+
config.before(:suite) do
|
61
|
+
ActiveRecord::Base.normally_open_transactions = 1
|
62
|
+
end
|
62
63
|
```
|
63
64
|
|
64
65
|
### Rails 3: after_commit hook can replace the first usage example:
|
data/lib/ar_after_transaction.rb
CHANGED
@@ -43,12 +43,10 @@ module ARAfterTransactionConnection
|
|
43
43
|
def transaction_with_after(**args)
|
44
44
|
clean = true
|
45
45
|
transaction_without_after(**args) do
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
raise
|
51
|
-
end
|
46
|
+
yield
|
47
|
+
rescue ActiveRecord::Rollback
|
48
|
+
clean = false
|
49
|
+
raise
|
52
50
|
end
|
53
51
|
rescue StandardError
|
54
52
|
clean = false
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ar_after_transaction
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.8.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:
|
11
|
+
date: 2022-01-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version:
|
19
|
+
version: 5.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '
|
22
|
+
version: '7.1'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version:
|
29
|
+
version: 5.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '
|
32
|
+
version: '7.1'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: bump
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -135,14 +135,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 2.
|
138
|
+
version: 2.6.0
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.1.
|
145
|
+
rubygems_version: 3.1.6
|
146
146
|
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Execute irreversible actions only when transactions are not rolled back
|