diff options
author | Vincent Wong <wingyu64@gmail.com> | 2016-12-22 01:59:54 +1100 |
---|---|---|
committer | Vincent Wong <wingyu64@gmail.com> | 2017-01-09 04:15:39 +1100 |
commit | b6df93a51f90c7ed29ce6667c6b1a8debf02506e (patch) | |
tree | ff13ffc730ceeb52635bad3204db1050d0e74947 /app/models/key.rb | |
parent | f264ec6ee74a0263b4e5212e921c4638c25f8fcd (diff) | |
download | gitlab-ce-b6df93a51f90c7ed29ce6667c6b1a8debf02506e.tar.gz |
Record and show last used date of SSH Keys
Addresses: Issue #13810
1. Adds a last_used_at attribute to the Key table/model
2. Update a key's last_used_at whenever it gets used
3. Display how long ago an ssh key was last used
Diffstat (limited to 'app/models/key.rb')
-rw-r--r-- | app/models/key.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/app/models/key.rb b/app/models/key.rb index 6f377f0e8ae..8be29c697f1 100644 --- a/app/models/key.rb +++ b/app/models/key.rb @@ -49,6 +49,10 @@ class Key < ActiveRecord::Base "key-#{id}" end + def update_last_used_at + UseKeyWorker.perform_async(self.id) + end + def add_to_shell GitlabShellWorker.perform_async( :add_key, |