summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-01 13:51:05 +0100
committerJacob Vosmaer <contact@jacobvosmaer.nl>2016-02-01 13:51:05 +0100
commit51574d779cac5b97ffb7603db783a26bfd6da1e6 (patch)
treecd75ea27e009328a788abbaf0f60c6a4f46dfc44 /lib/api/helpers.rb
parent64c8ee47c96d9245081abdf1b9d4ec39cdfc5883 (diff)
parentda8e0f86595299740a344309cb5963854b61c4a6 (diff)
downloadgitlab-ce-51574d779cac5b97ffb7603db783a26bfd6da1e6.tar.gz
Merge branch 'master' of https://gitlab.com/gitlab-org/gitlab-ce into lazy-blobs
Diffstat (limited to 'lib/api/helpers.rb')
-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!