Class: ActiveError::Fault
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ActiveError::Fault
- Defined in:
- app/models/active_error/fault.rb
Instance Method Summary collapse
- #exception ⇒ Object
- #location ⇒ Object
- #occurrences ⇒ Object
- #template ⇒ Object
- #template=(new_template) ⇒ Object
- #title ⇒ Object
Instance Method Details
#exception ⇒ Object
24 25 26 |
# File 'app/models/active_error/fault.rb', line 24 def exception ExceptionMock.make(fault: self) end |
#location ⇒ Object
44 45 46 |
# File 'app/models/active_error/fault.rb', line 44 def location Rails.backtrace_cleaner.clean(backtrace).first end |
#occurrences ⇒ Object
32 33 34 |
# File 'app/models/active_error/fault.rb', line 32 def occurrences "#{instances_count} #{'instance'.pluralize(instances_count)}" end |
#template ⇒ Object
36 37 38 |
# File 'app/models/active_error/fault.rb', line 36 def template Marshal.load(super) unless super.nil? # rubocop:disable Security/MarshalLoad end |
#template=(new_template) ⇒ Object
40 41 42 |
# File 'app/models/active_error/fault.rb', line 40 def template=(new_template) super(Marshal.dump(new_template)) end |
#title ⇒ Object
28 29 30 |
# File 'app/models/active_error/fault.rb', line 28 def title "#{klass}#{controller_display}#{action_display}" end |