Models Refactoring: Move methods to roles

This commit is contained in:
Dmitriy Zaporozhets 2012-06-07 15:44:57 +03:00
parent 98b8416647
commit 0a70aca3b1
20 changed files with 531 additions and 524 deletions

18
app/roles/ssh_key.rb Normal file
View file

@ -0,0 +1,18 @@
module SshKey
def update_repository
Gitlab::GitHost.system.new.configure do |c|
c.update_keys(identifier, key)
c.update_projects(projects)
end
end
def repository_delete_key
Gitlab::GitHost.system.new.configure do |c|
#delete key file is there is no identically deploy keys
if !is_deploy_key || Key.where(:identifier => identifier).count() == 0
c.delete_key(identifier)
end
c.update_projects(projects)
end
end
end