Class: ExceptionHunter::ErrorGroup
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- ExceptionHunter::ErrorGroup
- Defined in:
- app/models/exception_hunter/error_group.rb
Constant Summary collapse
- SIMILARITY_THRESHOLD =
0.75
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.find_matching_group(error) ⇒ Object
15 16 17 18 19 |
# File 'app/models/exception_hunter/error_group.rb', line 15 def self.find_matching_group(error) where(error_class_name: error.class_name) .most_similar(error..to_s) .first end |
Instance Method Details
#last_occurrence ⇒ Object
21 22 23 |
# File 'app/models/exception_hunter/error_group.rb', line 21 def last_occurrence @last_occurrence ||= grouped_errors.maximum(:occurred_at) end |
#total_occurrences ⇒ Object
25 26 27 |
# File 'app/models/exception_hunter/error_group.rb', line 25 def total_occurrences @total_occurrences ||= grouped_errors.count end |