2012-03-04 08:35:15 -05:00
|
|
|
class KeyObserver < ActiveRecord::Observer
|
2013-01-03 02:06:07 -05:00
|
|
|
include Gitolited
|
2012-08-28 17:04:06 -04:00
|
|
|
|
2012-03-04 08:35:15 -05:00
|
|
|
def after_save(key)
|
2013-02-11 12:27:26 -05:00
|
|
|
GitlabShellWorker.perform_async(
|
2013-02-04 08:07:56 -05:00
|
|
|
:add_key,
|
2013-02-05 04:12:15 -05:00
|
|
|
key.shell_id,
|
2013-02-04 08:07:56 -05:00
|
|
|
key.key
|
2013-01-28 14:02:10 -05:00
|
|
|
)
|
2012-03-04 08:35:15 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def after_destroy(key)
|
2013-02-11 12:27:26 -05:00
|
|
|
GitlabShellWorker.perform_async(
|
2013-01-28 14:02:10 -05:00
|
|
|
:remove_key,
|
2013-02-05 04:12:15 -05:00
|
|
|
key.shell_id,
|
2013-02-04 08:07:56 -05:00
|
|
|
key.key,
|
2013-01-28 14:02:10 -05:00
|
|
|
)
|
2012-03-04 08:35:15 -05:00
|
|
|
end
|
|
|
|
end
|