diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-05 11:12:15 +0200 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-02-05 11:12:15 +0200 |
commit | 39e37677f291c344e25583916a1811a052e38db6 (patch) | |
tree | 86124779ea619b6029050337465094946c2de983 /app | |
parent | 081c272b85d9344ff3a0b548f8f5eabc60e9a58d (diff) | |
download | gitlab-ce-39e37677f291c344e25583916a1811a052e38db6.tar.gz |
add remove keys from gitlab-shell by id
Diffstat (limited to 'app')
-rw-r--r-- | app/models/key.rb | 4 | ||||
-rw-r--r-- | app/observers/key_observer.rb | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index f1c9e42f04f..0c01edcbe71 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -81,7 +81,7 @@ class Key < ActiveRecord::Base Key.where(identifier: identifier).count == 0 end - def owner_name - user.username + def shell_id + "key-#{self.id}" end end diff --git a/app/observers/key_observer.rb b/app/observers/key_observer.rb index ad371d304c3..4146216d82f 100644 --- a/app/observers/key_observer.rb +++ b/app/observers/key_observer.rb @@ -4,7 +4,7 @@ class KeyObserver < ActiveRecord::Observer def after_save(key) GitoliteWorker.perform_async( :add_key, - key.owner_name, + key.shell_id, key.key ) end @@ -12,7 +12,7 @@ class KeyObserver < ActiveRecord::Observer def after_destroy(key) GitoliteWorker.perform_async( :remove_key, - key.owner_name, + key.shell_id, key.key, ) end |