Class: ActiveError::Fault

Inherits:
ApplicationRecord show all
Defined in:
app/models/active_error/fault.rb

Instance Method Summary collapse

Instance Method Details

#exceptionObject



22
23
24
# File 'app/models/active_error/fault.rb', line 22

def exception
  ExceptionMock.make(fault: self)
end

#occurrencesObject



30
31
32
# File 'app/models/active_error/fault.rb', line 30

def occurrences
  "#{instances_count} #{'instance'.pluralize(instances_count)}"
end

#templateObject



34
35
36
# File 'app/models/active_error/fault.rb', line 34

def template
  Marshal.load(super) unless super.nil? # rubocop:disable Security/MarshalLoad
end

#template=(new_template) ⇒ Object



38
39
40
# File 'app/models/active_error/fault.rb', line 38

def template=(new_template)
  super(Marshal.dump(new_template))
end

#titleObject



26
27
28
# File 'app/models/active_error/fault.rb', line 26

def title
  "#{klass}#{controller_display}#{action_display}"
end