From 0d0f25777a741819152b01cd7e8c63cacb82bed8 Mon Sep 17 00:00:00 2001 From: kingChan <281221230@qq.com> Date: Thu, 23 May 2024 17:20:30 +0800 Subject: [PATCH] =?UTF-8?q?=E6=96=B0=E5=A2=9Eissue=20=E5=85=B3=E8=81=94=20?= =?UTF-8?q?=E4=BF=AE=E5=A4=8Dpm=E5=B7=A5=E4=BD=9C=E9=A1=B9=E8=A2=AB?= =?UTF-8?q?=E5=88=A0=E9=99=A4=E5=90=8E=20=E5=85=B3=E8=81=94=E9=A1=B9?= =?UTF-8?q?=E4=BE=9D=E7=84=B6=E8=BF=98=E5=AD=98=E5=9C=A8=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/issue.rb | 1 + app/models/pm_link.rb | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/app/models/issue.rb b/app/models/issue.rb index 028ceb930..764708546 100644 --- a/app/models/issue.rb +++ b/app/models/issue.rb @@ -94,6 +94,7 @@ class Issue < ApplicationRecord has_many :attach_pull_requests, through: :pull_attached_issues, source: :pull_request # PM 关联工作项目 has_many :pm_links, as: :linkable, dependent: :destroy + has_many :be_pm_links,as: :be_linkable, dependent: :destroy belongs_to :changer, class_name: 'User', foreign_key: :changer_id, optional: true scope :issue_includes, ->{includes(:user)} diff --git a/app/models/pm_link.rb b/app/models/pm_link.rb index 91962bf7b..0e7d56b59 100644 --- a/app/models/pm_link.rb +++ b/app/models/pm_link.rb @@ -18,8 +18,9 @@ class PmLink < ApplicationRecord belongs_to :linkable, polymorphic: true + belongs_to :be_linkable, polymorphic: true - def be_linkable - be_linkable_type.constantize.find be_linkable_id - end + # def be_linkable + # be_linkable_type.constantize.find be_linkable_id + # end end