effective_resources 1.12.0 → 1.12.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3db298e3e7c154dc1aa2dbec87f22bcd2fe0c20b9ab565bea13a8305f6ba04f3
|
4
|
+
data.tar.gz: 6b79e28b6b7f8f7335313d769725e16f9f6deb799bdfa29fb0b1de6c5b459b3c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 82f53749182dc5a0f9b86c92171c0dc36eebf49fbeb874789a466143354fe28143c4d83e8caefae4b4e42f7157608ec58400f5ce4322b3609616ccf115d2235c
|
7
|
+
data.tar.gz: c388f8c66074503b1d04874419b71a5d5054ececd383d33a45087f0a17f65007fbd3f9aeb7c457c5d61ac3c36d1931a6b734756ea55ef807bd54c827e5143884
|
@@ -39,7 +39,8 @@ module Effective
|
|
39
39
|
def redirect_if_existing
|
40
40
|
return if step == 'wicked_finish'
|
41
41
|
return if resource.blank?
|
42
|
-
return if resource.done?
|
42
|
+
return if resource.try(:done?)
|
43
|
+
return unless resource_scope.respond_to?(:in_progress)
|
43
44
|
|
44
45
|
existing = resource_scope.in_progress.where.not(id: resource).first
|
45
46
|
return unless existing.present?
|
@@ -28,8 +28,10 @@ module Effective
|
|
28
28
|
def self.register_callback(connection:, name:, callback:)
|
29
29
|
raise ArgumentError, "#{name} expected a block" unless callback
|
30
30
|
|
31
|
-
|
32
|
-
|
31
|
+
in_transaction = (connection.transaction_open? && connection.current_transaction.joinable?)
|
32
|
+
|
33
|
+
# Execute immediately when outside transaction
|
34
|
+
return callback.call unless in_transaction
|
33
35
|
|
34
36
|
after_commit = Effective::AfterCommit.new("#{name}": callback)
|
35
37
|
connection.add_transaction_record(after_commit)
|