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:
parent
aded7056fd
commit
7cdc5b9e04
20 changed files with 155 additions and 88 deletions
|
@ -1,9 +1,12 @@
|
|||
class KeyObserver < ActiveRecord::Observer
|
||||
include GitHost
|
||||
|
||||
def after_save(key)
|
||||
key.update_repository
|
||||
git_host.set_key(key.identifier, key.key, key.projects)
|
||||
end
|
||||
|
||||
def after_destroy(key)
|
||||
key.repository_delete_key
|
||||
return if key.is_deploy_key && !key.last_deploy?
|
||||
git_host.remove_key(key.identifier, key.projects)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue