Class: Bulletin::Issue
- Inherits:
-
ApplicationRecord
- Object
- ActiveRecord::Base
- ApplicationRecord
- Bulletin::Issue
- Defined in:
- app/models/bulletin/issue.rb
Overview
One row per fingerprint — the triage unit. Holds Bullet’s own fix advice plus aggregate stats, so the list view is a single cheap query.
Instance Method Summary collapse
- #association_label ⇒ Object
- #endpoint ⇒ Object
- #label ⇒ Object
- #mute!(until_time = nil) ⇒ Object
- #reopen! ⇒ Object
- #resolve! ⇒ Object
Instance Method Details
#association_label ⇒ Object
23 24 25 |
# File 'app/models/bulletin/issue.rb', line 23 def association_label Array(associations).join(", ") end |
#endpoint ⇒ Object
31 32 33 |
# File 'app/models/bulletin/issue.rb', line 31 def endpoint [controller, action].compact.join("#") end |
#label ⇒ Object
27 28 29 |
# File 'app/models/bulletin/issue.rb', line 27 def label [base_class, association_label].reject(&:blank?).join(" → ") end |
#mute!(until_time = nil) ⇒ Object
43 44 45 |
# File 'app/models/bulletin/issue.rb', line 43 def mute!(until_time = nil) update!(status: :muted, muted_until: until_time) end |
#reopen! ⇒ Object
39 40 41 |
# File 'app/models/bulletin/issue.rb', line 39 def reopen! update!(status: :active, resolved_at: nil) end |
#resolve! ⇒ Object
35 36 37 |
# File 'app/models/bulletin/issue.rb', line 35 def resolve! update!(status: :resolved, resolved_at: Time.now) end |