Class: Bulletin::Issue

Inherits:
ApplicationRecord show all
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

Instance Method Details

#association_labelObject



23
24
25
# File 'app/models/bulletin/issue.rb', line 23

def association_label
  Array(associations).join(", ")
end

#endpointObject



31
32
33
# File 'app/models/bulletin/issue.rb', line 31

def endpoint
  [controller, action].compact.join("#")
end

#labelObject



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