debian-mirror-gitlab/app/models/issue_link.rb

21 lines
443 B
Ruby
Raw Normal View History

2020-11-24 15:15:51 +05:30
# frozen_string_literal: true
class IssueLink < ApplicationRecord
include FromUnion
2022-05-07 20:08:51 +05:30
include IssuableLink
2020-11-24 15:15:51 +05:30
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-05-07 20:08:51 +05:30
class << self
def issuable_type
:issue
2021-01-29 00:20:46 +05:30
end
end
2020-11-24 15:15:51 +05:30
end
2021-06-08 01:23:25 +05:30
IssueLink.prepend_mod_with('IssueLink')