Commit c83af0dfe7b82c355eb115a35bfee2a98146b64d
1 parent
b6c6a5b1
Exists in
master
and in
4 other branches
Uses attributes_for_keys
Showing
1 changed file
with
2 additions
and
4 deletions
Show diff stats
lib/api/keys.rb
... | ... | @@ -26,10 +26,8 @@ module Gitlab |
26 | 26 | # Example Request: |
27 | 27 | # POST /keys |
28 | 28 | post do |
29 | - key = current_user.keys.new( | |
30 | - title: params[:title], | |
31 | - key: params[:key] | |
32 | - ) | |
29 | + attrs = attributes_for_keys [:title, :key] | |
30 | + key = current_user.keys.new attrs | |
33 | 31 | if key.save |
34 | 32 | present key, with: Entities::Key |
35 | 33 | else | ... | ... |