mirror of
https://gitlink.org.cn/Gitlink/forgeplus.git
synced 2026-05-24 13:45:44 +08:00
FIX 重构ci流程
This commit is contained in:
19
app/models/ci/repo.rb
Normal file
19
app/models/ci/repo.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
class Ci::Repo < Ci::RemoteBase
|
||||
self.primary_key = 'repo_id'
|
||||
|
||||
belongs_to :user, foreign_key: :repo_user_id
|
||||
has_many :builds, foreign_key: "build_repo_id", dependent: :destroy
|
||||
|
||||
def self.find_with_namespace(namespace_path, identifier)
|
||||
logger.info "########namespace_path: #{namespace_path} ########identifier: #{identifier} "
|
||||
|
||||
user = Ci::User.find_by_user_login namespace_path
|
||||
return nil if user.blank?
|
||||
|
||||
repo = user.repos.find_by(repo_name: identifier)
|
||||
|
||||
return nil if repo.blank?
|
||||
[user, repo]
|
||||
end
|
||||
|
||||
end
|
||||
Reference in New Issue
Block a user