2020-08-21 00:10:44 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class IssueLink < ApplicationRecord
|
|
|
|
include FromUnion
|
2022-02-21 15:19:50 +00:00
|
|
|
include IssuableLink
|
2020-08-21 00:10:44 +00:00
|
|
|
|
|
|
|
belongs_to :source, class_name: 'Issue'
|
|
|
|
belongs_to :target, class_name: 'Issue'
|
|
|
|
|
|
|
|
scope :for_source_issue, ->(issue) { where(source_id: issue.id) }
|
|
|
|
scope :for_target_issue, ->(issue) { where(target_id: issue.id) }
|
|
|
|
|
2022-03-01 12:19:32 +00:00
|
|
|
class << self
|
|
|
|
def issuable_type
|
|
|
|
:issue
|
|
|
|
end
|
2020-11-11 03:08:57 +00:00
|
|
|
end
|
2020-08-21 00:10:44 +00:00
|
|
|
end
|
|
|
|
|
2021-05-11 21:10:21 +00:00
|
|
|
IssueLink.prepend_mod_with('IssueLink')
|