after_commit_everywhere 0.1.0 → 0.1.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/after_commit_everywhere.rb +5 -3
- data/lib/after_commit_everywhere/version.rb +1 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 208fab154c7355e827669ffb9943b8dd9d320ec8096284f4a35bfff45b5d6301
|
4
|
+
data.tar.gz: 95989a3e5c164f21371ccd8102e2d51ba99c4b303a956c83fde73b733fce700a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7bdad3cb3d1e23a2ee124e06a43340c0fe6af8737d1e59e276aec40277ffb3cc662b4ec2de7856154dfb914ae69b97ca3aa977c87bf888f60367a5cf86a169a3
|
7
|
+
data.tar.gz: 7be979c08769da19778405d59d4808b0e402ff5d943c6ed541026056d8eea005fc6df98b41730b04de2f2f188256ade720726dbd09f5c75306faaa875bdd4b8b
|
@@ -25,7 +25,7 @@ module AfterCommitEverywhere
|
|
25
25
|
connection: connection,
|
26
26
|
name: __callee__,
|
27
27
|
callback: callback,
|
28
|
-
no_tx_action: :
|
28
|
+
no_tx_action: :execute,
|
29
29
|
)
|
30
30
|
end
|
31
31
|
|
@@ -41,7 +41,7 @@ module AfterCommitEverywhere
|
|
41
41
|
connection: connection,
|
42
42
|
name: __callee__,
|
43
43
|
callback: callback,
|
44
|
-
no_tx_action: :
|
44
|
+
no_tx_action: :warn_and_execute,
|
45
45
|
)
|
46
46
|
end
|
47
47
|
|
@@ -69,9 +69,11 @@ module AfterCommitEverywhere
|
|
69
69
|
raise ArgumentError, "Provide callback to #{name}" unless callback
|
70
70
|
unless in_transaction?(connection)
|
71
71
|
case no_tx_action
|
72
|
-
when :
|
72
|
+
when :warn_and_execute
|
73
73
|
warn "#{name}: No transaction open. Executing callback immediately."
|
74
74
|
return callback.call
|
75
|
+
when :execute
|
76
|
+
return callback.call
|
75
77
|
when :exception
|
76
78
|
raise NotInTransaction, "#{name} is useless outside transaction"
|
77
79
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: after_commit_everywhere
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrey Novikov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-03-
|
11
|
+
date: 2018-03-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -150,6 +150,7 @@ files:
|
|
150
150
|
- lib/after_commit_everywhere.rb
|
151
151
|
- lib/after_commit_everywhere/version.rb
|
152
152
|
- lib/after_commit_everywhere/wrap.rb
|
153
|
+
- tmp/.keep
|
153
154
|
homepage: https://github.com/Envek/after_commit_everywhere
|
154
155
|
licenses:
|
155
156
|
- MIT
|