diff options
Diffstat (limited to 'app/models/work_items/related_work_item_link.rb')
-rw-r--r-- | app/models/work_items/related_work_item_link.rb | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/app/models/work_items/related_work_item_link.rb b/app/models/work_items/related_work_item_link.rb new file mode 100644 index 00000000000..4de197d3d35 --- /dev/null +++ b/app/models/work_items/related_work_item_link.rb @@ -0,0 +1,27 @@ +# frozen_string_literal: true + +module WorkItems + class RelatedWorkItemLink < ApplicationRecord + include LinkableItem + + self.table_name = 'issue_links' + + belongs_to :source, class_name: 'WorkItem' + belongs_to :target, class_name: 'WorkItem' + + class << self + extend ::Gitlab::Utils::Override + + # Used as issuable table name for calculating blocked and blocking count in IssuableLink + override :issuable_type + def issuable_type + :issue + end + + override :issuable_name + def issuable_name + 'work item' + end + end + end +end |