API attributes refactored
This commit is contained in:
parent
caef9ed112
commit
549c4c2202
4 changed files with 36 additions and 52 deletions
|
@ -28,6 +28,14 @@ module Gitlab
|
|||
end
|
||||
end
|
||||
|
||||
def existed_attributes(keys)
|
||||
attrs = {}
|
||||
keys.each do |key|
|
||||
attrs[key] = params[key] if params[key].present?
|
||||
end
|
||||
attrs
|
||||
end
|
||||
|
||||
# error helpers
|
||||
|
||||
def forbidden!
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue