summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorAlex Denisov <1101.debian@gmail.com>2012-09-16 19:51:04 +0300
committerAlex Denisov <1101.debian@gmail.com>2012-09-16 19:51:04 +0300
commit549c4c2202307608773a10d8ce9a7dc978537de4 (patch)
treedfaee2e6f03e4f3c84878f5ae9323bfade7f5bac /lib/api/helpers.rb
parentcaef9ed1121a16ca0cc78715695daaa974271bfd (diff)
downloadgitlab-ce-549c4c2202307608773a10d8ce9a7dc978537de4.tar.gz
API attributes refactored
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!