summaryrefslogtreecommitdiff
path: root/app/controllers/profiles/keys_controller.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2017-10-24 09:52:47 +0300
committerJames Lopez <james@jameslopez.es>2017-10-31 09:03:59 +0100
commitd0546e6d81fa3eb9424db9beb5e34d351fabb0fc (patch)
tree95a12fcf979d34b7f793c3fa3145157604e05382 /app/controllers/profiles/keys_controller.rb
parent72b7b10d52de1b150b124c017427b2802b4193e6 (diff)
downloadgitlab-ce-d0546e6d81fa3eb9424db9beb5e34d351fabb0fc.tar.gz
uypdated keys controller logic
Diffstat (limited to 'app/controllers/profiles/keys_controller.rb')
-rw-r--r--app/controllers/profiles/keys_controller.rb10
1 files changed, 2 insertions, 8 deletions
diff --git a/app/controllers/profiles/keys_controller.rb b/app/controllers/profiles/keys_controller.rb
index 069e6a810f2..f0e5d2aa94e 100644
--- a/app/controllers/profiles/keys_controller.rb
+++ b/app/controllers/profiles/keys_controller.rb
@@ -11,10 +11,10 @@ class Profiles::KeysController < Profiles::ApplicationController
end
def create
- @key = Keys::CreateService.new(current_user, key_params).execute
+ @key = Keys::CreateService.new(current_user, key_params.merge(ip_address: request.remote_ip)).execute
if @key.persisted?
- redirect_to_profile_key_path
+ redirect_to profile_key_path(@key)
else
@keys = current_user.keys.select(&:persisted?)
render :index
@@ -50,12 +50,6 @@ class Profiles::KeysController < Profiles::ApplicationController
end
end
- protected
-
- def redirect_to_profile_key_path
- redirect_to profile_key_path(@key)
- end
-
private
def key_params