Make gitlab works with gitlab-shell

This commit is contained in:
Dmitriy Zaporozhets 2013-02-04 15:07:56 +02:00
parent 6b9a609044
commit 27d9ac0fe8
9 changed files with 44 additions and 71 deletions

View file

@ -80,4 +80,8 @@ class Key < ActiveRecord::Base
def last_deploy?
Key.where(identifier: identifier).count == 0
end
def owner_name
user.username
end
end

View file

@ -459,20 +459,6 @@ class Project < ActiveRecord::Base
namespace.try(:path) || ''
end
def update_repository
GitoliteWorker.perform_async(
:update_repository,
self.id
)
end
def destroy_repository
GitoliteWorker.perform_async(
:remove_repository,
self.path_with_namespace
)
end
def repo_exists?
@repo_exists ||= (repository && repository.branches.present?)
rescue

View file

@ -25,9 +25,6 @@ class UsersProject < ActiveRecord::Base
attr_accessor :skip_git
after_save :update_repository, unless: :skip_git?
after_destroy :update_repository, unless: :skip_git?
validates :user, presence: true
validates :user_id, uniqueness: { scope: [:project_id], message: "already exists in project" }
validates :project_access, inclusion: { in: [GUEST, REPORTER, DEVELOPER, MASTER] }, presence: true
@ -136,10 +133,6 @@ class UsersProject < ActiveRecord::Base
end
end
def update_repository
project.update_repository
end
def project_access_human
Project.access_options.key(self.project_access)
end