Class: ExceptionHunter::ErrorReaper
- Inherits:
-
Object
- Object
- ExceptionHunter::ErrorReaper
- Defined in:
- lib/exception_hunter/error_reaper.rb
Overview
Class in charge of disposing of stale errors as specified in the Config.
Class Method Summary collapse
-
.purge(stale_time: Config.errors_stale_time) ⇒ void
Destroys all stale errors.
Class Method Details
.purge(stale_time: Config.errors_stale_time) ⇒ void
This method returns an undefined value.
Destroys all stale errors.
12 13 14 15 16 17 |
# File 'lib/exception_hunter/error_reaper.rb', line 12 def purge(stale_time: Config.errors_stale_time) ActiveRecord::Base.transaction do Error.with_occurrences_before(Date.today - stale_time).destroy_all ErrorGroup.without_errors.destroy_all end end |