2013-03-26 17:11:38 +01:00
|
|
|
class KeyObserver < BaseObserver
|
2012-03-04 14:35:15 +01:00
|
|
|
def after_save(key)
|
2013-02-11 18:27:26 +01:00
|
|
|
GitlabShellWorker.perform_async(
|
2013-02-04 14:07:56 +01:00
|
|
|
:add_key,
|
2013-02-05 10:12:15 +01:00
|
|
|
key.shell_id,
|
2013-02-04 14:07:56 +01:00
|
|
|
key.key
|
2013-01-28 20:02:10 +01:00
|
|
|
)
|
2013-03-19 19:00:41 +01:00
|
|
|
|
2013-03-26 17:11:38 +01:00
|
|
|
notification.new_key(key)
|
2012-03-04 14:35:15 +01:00
|
|
|
end
|
|
|
|
|
|
|
|
def after_destroy(key)
|
2013-02-11 18:27:26 +01:00
|
|
|
GitlabShellWorker.perform_async(
|
2013-01-28 20:02:10 +01:00
|
|
|
:remove_key,
|
2013-02-05 10:12:15 +01:00
|
|
|
key.shell_id,
|
2013-02-04 14:07:56 +01:00
|
|
|
key.key,
|
2013-01-28 20:02:10 +01:00
|
|
|
)
|
2012-03-04 14:35:15 +01:00
|
|
|
end
|
|
|
|
end
|