more refactoring using models/concerns

This commit is contained in:
Dmitriy Zaporozhets 2013-01-03 09:06:07 +02:00
parent 40a956eb68
commit da03a5c7e2
10 changed files with 58 additions and 68 deletions

View file

@ -1,12 +1,12 @@
class KeyObserver < ActiveRecord::Observer
include GitHost
include Gitolited
def after_save(key)
git_host.set_key(key.identifier, key.key, key.projects)
gitolite.set_key(key.identifier, key.key, key.projects)
end
def after_destroy(key)
return if key.is_deploy_key && !key.last_deploy?
git_host.remove_key(key.identifier, key.projects)
gitolite.remove_key(key.identifier, key.projects)
end
end