summaryrefslogtreecommitdiff
path: root/app/controllers/profiles
diff options
context:
space:
mode:
authorGitLab <devaroop123@yahoo.co.in>2014-02-11 19:04:47 +0530
committerGitLab <devaroop123@yahoo.co.in>2014-02-11 19:04:47 +0530
commit46ad09bf70400eeebab5495ee6a5ded4da86012e (patch)
tree0501f89cfaf71108bb95d1a1dbadb1bebf7634f8 /app/controllers/profiles
parent5101ff7bec35704d844df8e608f604abd22df57a (diff)
downloadgitlab-ce-46ad09bf70400eeebab5495ee6a5ded4da86012e.tar.gz
code refactor as per standards
Diffstat (limited to 'app/controllers/profiles')
-rw-r--r--app/controllers/profiles/keys_controller.rb11
1 files changed, 7 insertions, 4 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb
index 7c97987d006..e8237a1f227 100644
--- a/app/controllers/profiles/keys_controller.rb
+++ b/app/controllers/profiles/keys_controller.rb
@@ -34,14 +34,17 @@ class Profiles::KeysController < ApplicationController
end
end
- #get all keys of a user(params[:username]) in a text format
- #helpful for sysadmins to put in respective servers
+ # Get all keys of a user(params[:username]) in a text format
+ # Helpful for sysadmins to put in respective servers
def get_keys
if params[:username].present?
begin
user = User.find_by_username(params[:username])
- user.present? ? (render :text => user.all_ssh_keys.join('\n')) :
- (render_404 and return)
+ if user.present?
+ render text: user.all_ssh_keys.join('\n')
+ else
+ render_404 and return
+ end
rescue => e
render text: e.message
end