summaryrefslogtreecommitdiff
path: root/app/models/event.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/event.rb')
-rw-r--r--app/models/event.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/app/models/event.rb b/app/models/event.rb
index ed65b367b8a..333841b1f90 100644
--- a/app/models/event.rb
+++ b/app/models/event.rb
@@ -31,6 +31,7 @@ class Event < ApplicationRecord
DESIGN_ACTIONS = [:created, :updated, :destroyed].freeze
TEAM_ACTIONS = [:joined, :left, :expired].freeze
ISSUE_ACTIONS = [:created, :updated, :closed, :reopened].freeze
+ ISSUE_TYPES = [Issue.name, WorkItem.name].freeze
TARGET_TYPES = HashWithIndifferentAccess.new(
issue: Issue,
@@ -83,6 +84,7 @@ class Event < ApplicationRecord
scope :recent, -> { reorder(id: :desc) }
scope :for_wiki_page, -> { where(target_type: 'WikiPage::Meta') }
scope :for_design, -> { where(target_type: 'DesignManagement::Design') }
+ scope :for_issue, -> { where(target_type: ISSUE_TYPES) }
scope :for_fingerprint, ->(fingerprint) do
fingerprint.present? ? where(fingerprint: fingerprint) : none
end