debian-mirror-gitlab/app/services/issue_links/create_service.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

30 lines
665 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
module IssueLinks
class CreateService < IssuableLinks::CreateService
2022-06-21 17:19:12 +05:30
include IncidentManagement::UsageData
2020-11-24 15:15:51 +05:30
def linkable_issuables(issues)
@linkable_issuables ||= begin
issues.select { |issue| can?(current_user, :admin_issue_link, issue) }
end
end
def previous_related_issuables
@related_issues ||= issuable.related_issues(current_user).to_a
end
private
def track_event
track_incident_action(current_user, issuable, :incident_relate)
end
2022-05-07 20:08:51 +05:30
def link_class
IssueLink
end
2020-11-24 15:15:51 +05:30
end
end
2021-06-08 01:23:25 +05:30
IssueLinks::CreateService.prepend_mod_with('IssueLinks::CreateService')