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
Methods inherited from ApplicationRecord
Class Method Details
.find_matching_group(error) ⇒ Object
30 31 32 33 34 |
# File 'app/models/exception_hunter/error_group.rb', line 30 def self.find_matching_group(error) where(error_class_name: error.class_name) .most_similar(error..to_s) .first end |
Instance Method Details
#first_occurrence ⇒ Object
36 37 38 |
# File 'app/models/exception_hunter/error_group.rb', line 36 def first_occurrence @first_occurrence ||= grouped_errors.minimum(:occurred_at) end |
#last_occurrence ⇒ Object
40 41 42 |
# File 'app/models/exception_hunter/error_group.rb', line 40 def last_occurrence @last_occurrence ||= grouped_errors.maximum(:occurred_at) end |
#total_occurrences ⇒ Object
44 45 46 |
# File 'app/models/exception_hunter/error_group.rb', line 44 def total_occurrences @total_occurrences ||= grouped_errors.count end |