FIX 解决forked项目删除后,fork user没有关联删除的bug
This commit is contained in:
parent
dc3ec48b8c
commit
ef4578286f
|
@ -1,4 +1,6 @@
|
|||
class ForkUser < ApplicationRecord
|
||||
belongs_to :project
|
||||
belongs_to :project
|
||||
belongs_to :user
|
||||
belongs_to :fork_project, class_name: 'ForkUser', foreign_key: :fork_project_id
|
||||
|
||||
end
|
||||
|
|
|
@ -18,6 +18,7 @@ class Project < ApplicationRecord
|
|||
has_many :project_trends, dependent: :destroy
|
||||
has_many :watchers, as: :watchable, dependent: :destroy
|
||||
has_many :fork_users, dependent: :destroy
|
||||
has_many :forked_users, class_name: 'ForkUser', foreign_key: :fork_project_id, dependent: :destroy
|
||||
# has_many :commits, dependent: :destroy
|
||||
|
||||
has_one :project_score, dependent: :destroy
|
||||
|
|
Loading…
Reference in New Issue