summaryrefslogtreecommitdiff
path: root/lib/api/keys.rb
diff options
context:
space:
mode:
authorAlex Denisov <1101.debian@gmail.com>2012-09-16 22:44:20 +0300
committerAlex Denisov <1101.debian@gmail.com>2012-09-16 22:44:20 +0300
commitc83af0dfe7b82c355eb115a35bfee2a98146b64d (patch)
tree95085052ec09c568d38f859c983ab865b1c2e030 /lib/api/keys.rb
parentb6c6a5b159beeb63829c72f5d7e2c48b1138705d (diff)
downloadgitlab-ce-c83af0dfe7b82c355eb115a35bfee2a98146b64d.tar.gz
Uses attributes_for_keys
Diffstat (limited to 'lib/api/keys.rb')
-rw-r--r--lib/api/keys.rb6
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/api/keys.rb b/lib/api/keys.rb
index d58c7caf5ce..4c302727c4f 100644
--- a/lib/api/keys.rb
+++ b/lib/api/keys.rb
@@ -26,10 +26,8 @@ module Gitlab
# Example Request:
# POST /keys
post do
- key = current_user.keys.new(
- title: params[:title],
- key: params[:key]
- )
+ attrs = attributes_for_keys [:title, :key]
+ key = current_user.keys.new attrs
if key.save
present key, with: Entities::Key
else