2020-08-20 20:10:44 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class IssueLink < ApplicationRecord
|
|
|
|
include FromUnion
|
2022-02-21 10:19:50 -05:00
|
|
|
include IssuableLink
|
2020-08-20 20:10:44 -04: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 07:19:32 -05:00
|
|
|
class << self
|
|
|
|
def issuable_type
|
|
|
|
:issue
|
|
|
|
end
|
2020-11-10 22:08:57 -05:00
|
|
|
end
|
2020-08-20 20:10:44 -04:00
|
|
|
end
|
|
|
|
|
2021-05-11 17:10:21 -04:00
|
|
|
IssueLink.prepend_mod_with('IssueLink')
|