Class: ActiveError::Fault

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

Instance Method Summary collapse

Instance Method Details

#exceptionObject



24
25
26
# File 'app/models/active_error/fault.rb', line 24

def exception
  ExceptionMock.make(fault: self)
end

#locationObject



44
45
46
# File 'app/models/active_error/fault.rb', line 44

def location
  Rails.backtrace_cleaner.clean(backtrace).first
end

#occurrencesObject



32
33
34
# File 'app/models/active_error/fault.rb', line 32

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

#templateObject



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

#titleObject



28
29
30
# File 'app/models/active_error/fault.rb', line 28

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