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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c1df0059bb23c523cc58320933ab8f104a7b422dc7bd61fb63a6df9bed70b0b8
4
- data.tar.gz: 794f35a422fa0035e16b9ce211bd5c322f039a59ce433f20321d9d39e217ebd1
3
+ metadata.gz: 4e6799fce4d3edf03f5a9968b9edda80e52dd4d7fae95b5b9ccfdf723d224aa6
4
+ data.tar.gz: 25cc0da36e5d829de8fcbc5219e0f8524ed7b5deff9a65bde0277f3b86527955
5
5
  SHA512:
6
- metadata.gz: 71de87c4f51876e9703fed4902608445e665d778a524f7e7aa0a55e24195f9d0daf05289fe8d775c944c11447d025bd3244d423bbb5bee035c627b4ab76c4034
7
- data.tar.gz: dd084fcdd77ded9908ca5cce93447b4c1e56f4178b4956adf721eecd1da016ce54495fd43ba2860314af8b0560903a9087cce21ecaa12463f7206ef05191c998
6
+ metadata.gz: 594ba035cff8f99a47a3fac04df27cc9c512ee949e89504b5b085e3cefe03fb0e0adfeca15a8d9e0ec1f71bd3db8dd3a1abf6018fae98a93abd648a3ef34af96
7
+ data.tar.gz: 806d598764d3ba08c8b7200dc925493cc6c5ea5ddefb2d47036a87587b7b770b68fe645d8de858b679f7bcba1a4a9c2b5a348dece82bcff1996a7348bb4af642
@@ -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
 
@@ -1,3 +1,3 @@
1
1
  module Performify
2
- VERSION = '0.8.0'.freeze
2
+ VERSION = '0.9.0'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: performify
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.9.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sergey Tsvetkov