Class: RailsWorkflow::Error
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- RailsWorkflow::Error
- Includes:
- HasContext
- Defined in:
- app/models/rails_workflow/error.rb
Overview
Stores error information
Instance Method Summary collapse
- #can_restart_process? ⇒ Boolean
- #config ⇒ Object
- #error_resolver ⇒ Object
- #operation ⇒ Object
- #process ⇒ Object
- #target ⇒ Object
Instance Method Details
#can_restart_process? ⇒ Boolean
13 14 15 |
# File 'app/models/rails_workflow/error.rb', line 13 def can_restart_process? process.unresolved_errors.count.zero? end |
#config ⇒ Object
35 36 37 |
# File 'app/models/rails_workflow/error.rb', line 35 def config RailsWorkflow.config end |
#error_resolver ⇒ Object
39 40 41 |
# File 'app/models/rails_workflow/error.rb', line 39 def error_resolver @error_resolver ||= config.error_resolver.new(self) end |
#operation ⇒ Object
21 22 23 |
# File 'app/models/rails_workflow/error.rb', line 21 def operation parent if parent.is_a? RailsWorkflow::Operation end |
#process ⇒ Object
25 26 27 28 29 30 31 32 33 |
# File 'app/models/rails_workflow/error.rb', line 25 def process if operation operation.process elsif target.is_a? RailsWorkflow::Process target elsif parent.is_a? RailsWorkflow::Process parent end end |
#target ⇒ Object
17 18 19 |
# File 'app/models/rails_workflow/error.rb', line 17 def target data[:target] end |