更改:解绑操作放在回调里

This commit is contained in:
2024-05-06 13:56:45 +08:00
parent 4cacc91130
commit 61f893ba0a
2 changed files with 8 additions and 1 deletions

View File

@@ -24,5 +24,12 @@ class SyncRepository < ApplicationRecord
belongs_to :project
has_many :sync_repository_branches, dependent: :destroy
before_destroy :unbind_reposyncer
validates :repo_name, uniqueness: { message: "已存在" }
def unbind_reposyncer
Reposync::DeleteRepoService.call(self.repo_name)
end
end