新增issue 关联 修复pm工作项被删除后 关联项依然还存在的问题
This commit is contained in:
parent
6694ed625f
commit
0d0f25777a
|
@ -94,6 +94,7 @@ class Issue < ApplicationRecord
|
||||||
has_many :attach_pull_requests, through: :pull_attached_issues, source: :pull_request
|
has_many :attach_pull_requests, through: :pull_attached_issues, source: :pull_request
|
||||||
# PM 关联工作项目
|
# PM 关联工作项目
|
||||||
has_many :pm_links, as: :linkable, dependent: :destroy
|
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
|
belongs_to :changer, class_name: 'User', foreign_key: :changer_id, optional: true
|
||||||
|
|
||||||
scope :issue_includes, ->{includes(:user)}
|
scope :issue_includes, ->{includes(:user)}
|
||||||
|
|
|
@ -18,8 +18,9 @@
|
||||||
|
|
||||||
class PmLink < ApplicationRecord
|
class PmLink < ApplicationRecord
|
||||||
belongs_to :linkable, polymorphic: true
|
belongs_to :linkable, polymorphic: true
|
||||||
|
belongs_to :be_linkable, polymorphic: true
|
||||||
|
|
||||||
def be_linkable
|
# def be_linkable
|
||||||
be_linkable_type.constantize.find be_linkable_id
|
# be_linkable_type.constantize.find be_linkable_id
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in New Issue