新增:导出工作项关联工作项记录

This commit is contained in:
2024-08-27 13:42:02 +08:00
parent 9f0956ac75
commit fb572af48f
3 changed files with 92 additions and 42 deletions

View File

@@ -18,6 +18,9 @@
class PmLink < ApplicationRecord
belongs_to :linkable, polymorphic: true
belongs_to :be_linkable, polymorphic: true
belongs_to :linkable_issue, -> {where(pm_links: {linkable_type: 'Issue'})}, foreign_key: 'linkable_id', class_name: 'Issue'
belongs_to :be_linkable_issue, -> {where(pm_links: {be_linkable_type: 'Issue'})}, foreign_key: 'be_linkable_id', class_name: 'Issue'
def be_linkable
be_linkable_type.constantize.find be_linkable_id