gitlab-org--gitlab-foss/app/models/issue_link.rb

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

21 lines
443 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class IssueLink < ApplicationRecord
include FromUnion
include IssuableLink
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) }
class << self
def issuable_type
:issue
end
end
end
IssueLink.prepend_mod_with('IssueLink')