diff options
Diffstat (limited to 'lib/api/helpers.rb')
| -rw-r--r-- | lib/api/helpers.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index 054eb2d3f70..9a08b995800 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -28,6 +28,14 @@ module Gitlab end end + def attributes_for_keys(keys) + attrs = {} + keys.each do |key| + attrs[key] = params[key] if params[key].present? + end + attrs + end + # error helpers def forbidden! |
