gitlabhq/app/observers/key_observer.rb
Sytse Sijbrandij b80dd3d242 Non-interactive AWS install by running a single script.
Merge branch 'master' into non-interactive-aws-install

Conflicts:
	doc/installation.md

Fix merge mess in installation.md
2012-09-02 18:39:50 +02:00

12 lines
293 B
Ruby

class KeyObserver < ActiveRecord::Observer
include GitHost
def after_save(key)
git_host.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)
end
end