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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6eb14b053c0170cfb885875b2b5c0f50fbd1d84f09847b939e87eb875aac28a4
4
- data.tar.gz: 1610ebf77543a2d55ce3208ecc7d739667544ef6dfa5dc4f72f86d5b8e53c4ff
3
+ metadata.gz: 208fab154c7355e827669ffb9943b8dd9d320ec8096284f4a35bfff45b5d6301
4
+ data.tar.gz: 95989a3e5c164f21371ccd8102e2d51ba99c4b303a956c83fde73b733fce700a
5
5
  SHA512:
6
- metadata.gz: f308a4913a2b8557e3027cbdebe357d45cede83d4a0f818afb598d0157610c72bc4777a18409402b9c67f63a1e50b803a6bc87c34487f473e514799df0306cf6
7
- data.tar.gz: f3aaddff157104f2afab4924cc84d94b83c02028e85b5119a98ec8e76aadb003133e3f3b24f4bd8dd062ffa5a0b861cd80d439db098e653e421160370cc40764
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: :warn,
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: :warn,
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 :warn
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module AfterCommitEverywhere
4
- VERSION = '0.1.0'
4
+ VERSION = '0.1.1'
5
5
  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.0
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-18 00:00:00.000000000 Z
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