Use similar interface to access gitolite

Simplified gitolite handle logic
Stubn over monkeypatch
Stub only specific methods in Gitlab:Gitolite
Moved grach auth to lib
added specs for keys observer
removes SshKey role
This commit is contained in:
randx 2012-08-29 00:04:06 +03:00
parent aded7056fd
commit 7cdc5b9e04
20 changed files with 155 additions and 88 deletions

View file

@ -1,7 +1,6 @@
require 'digest/md5'
class Key < ActiveRecord::Base
include SshKey
belongs_to :user
belongs_to :project
@ -50,6 +49,10 @@ class Key < ActiveRecord::Base
user.projects
end
end
def last_deploy?
Key.where(identifier: identifier).count == 0
end
end
# == Schema Information
#

View file

@ -1,4 +1,6 @@
class ProtectedBranch < ActiveRecord::Base
include GitHost
belongs_to :project
validates_presence_of :project_id
validates_presence_of :name
@ -7,7 +9,7 @@ class ProtectedBranch < ActiveRecord::Base
after_destroy :update_repository
def update_repository
Gitlab::GitHost.system.update_project(project.path, project)
git_host.update_repository(project)
end
def commit

View file

@ -1,4 +1,6 @@
class UsersProject < ActiveRecord::Base
include GitHost
GUEST = 10
REPORTER = 20
DEVELOPER = 30
@ -58,9 +60,7 @@ class UsersProject < ActiveRecord::Base
end
def update_repository
Gitlab::GitHost.system.new.configure do |c|
c.update_project(project.path, project)
end
git_host.update_repository(project)
end
def project_access_human