summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/api/helpers.rb')
-rw-r--r--lib/api/helpers.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 054eb2d3f70..d0fc8c434a2 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -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!