fixed 删除用户时issue,pr跟随项目数据

This commit is contained in:
2024-10-09 15:00:23 +08:00
parent 5c2f84141e
commit 4e855a2a7b
2 changed files with 3 additions and 3 deletions

View File

@@ -34,7 +34,7 @@ class PullRequest < ApplicationRecord
belongs_to :issue
belongs_to :user
belongs_to :project, counter_cache: true, touch: true
belongs_to :project, counter_cache: true, touch: true, optional: true
belongs_to :fork_project, class_name: 'Project', foreign_key: :fork_project_id, optional: true
has_many :pull_request_assigns, foreign_key: :pull_request_id
has_many :pull_request_tags, foreign_key: :pull_request_id