summaryrefslogtreecommitdiff
path: root/lib/api
diff options
context:
space:
mode:
authorDouwe Maan <douwe@selenight.nl>2016-01-28 15:12:24 +0100
committerDouwe Maan <douwe@selenight.nl>2016-01-28 15:12:24 +0100
commitb7ec476205173b9ca1780843ceb4617fdde0b9d7 (patch)
tree85e3c3e5012eefc78b51823b1c45185df447b720 /lib/api
parent30b0d06e9f74f0068926314ec03b003fbd86c8f2 (diff)
parent9bf47f06ab69a1592cec87825aaaf5bb4adec464 (diff)
downloadgitlab-ce-mr-merge-base.tar.gz
Merge branch 'master' into mr-merge-basemr-merge-base
Diffstat (limited to 'lib/api')
-rw-r--r--lib/api/helpers.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb
index 3f528b9f7c0..9dacf7c1e86 100644
--- a/lib/api/helpers.rb
+++ b/lib/api/helpers.rb
@@ -153,10 +153,11 @@ module API
end
def attributes_for_keys(keys, custom_params = nil)
+ params_hash = custom_params || params
attrs = {}
keys.each do |key|
- if params[key].present? or (params.has_key?(key) and params[key] == false)
- attrs[key] = params[key]
+ if params_hash[key].present? or (params_hash.has_key?(key) and params_hash[key] == false)
+ attrs[key] = params_hash[key]
end
end
ActionController::Parameters.new(attrs).permit!