performify 0.8.0 → 0.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/performify/base.rb +5 -3
- data/lib/performify/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4e6799fce4d3edf03f5a9968b9edda80e52dd4d7fae95b5b9ccfdf723d224aa6
|
4
|
+
data.tar.gz: 25cc0da36e5d829de8fcbc5219e0f8524ed7b5deff9a65bde0277f3b86527955
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 594ba035cff8f99a47a3fac04df27cc9c512ee949e89504b5b085e3cefe03fb0e0adfeca15a8d9e0ec1f71bd3db8dd3a1abf6018fae98a93abd648a3ef34af96
|
7
|
+
data.tar.gz: 806d598764d3ba08c8b7200dc925493cc6c5ea5ddefb2d47036a87587b7b770b68fe645d8de858b679f7bcba1a4a9c2b5a348dece82bcff1996a7348bb4af642
|
data/lib/performify/base.rb
CHANGED
@@ -9,6 +9,7 @@ module Performify
|
|
9
9
|
attr_reader :current_user
|
10
10
|
attr_reader :args
|
11
11
|
attr_reader :inputs
|
12
|
+
attr_reader :exception
|
12
13
|
|
13
14
|
def initialize(current_user = nil, args = {})
|
14
15
|
@current_user = current_user
|
@@ -30,8 +31,8 @@ module Performify
|
|
30
31
|
else
|
31
32
|
fail!(with_callbacks: false)
|
32
33
|
end
|
33
|
-
rescue RuntimeError, ActiveRecord::RecordInvalid
|
34
|
-
fail!
|
34
|
+
rescue RuntimeError, ActiveRecord::RecordInvalid => e
|
35
|
+
fail!(exception: e)
|
35
36
|
end
|
36
37
|
|
37
38
|
raise ActiveRecord::Rollback if fail?
|
@@ -55,10 +56,11 @@ module Performify
|
|
55
56
|
@result
|
56
57
|
end
|
57
58
|
|
58
|
-
def fail!(with_callbacks: true, errors: nil)
|
59
|
+
def fail!(with_callbacks: true, errors: nil, exception: nil)
|
59
60
|
@result = false
|
60
61
|
errors!(errors) unless errors.nil?
|
61
62
|
execute_callbacks if with_callbacks
|
63
|
+
@exception = exception unless exception.nil?
|
62
64
|
@result
|
63
65
|
end
|
64
66
|
|
data/lib/performify/version.rb
CHANGED