summaryrefslogtreecommitdiff
path: root/lib/api/helpers.rb
diff options
context:
space:
mode:
authorJames Lopez <james@jameslopez.es>2016-01-29 14:27:10 +0100
committerJames Lopez <james@jameslopez.es>2016-01-29 14:27:10 +0100
commit7ca6779654ed2da5ba31ab9256406feb1b7fb8ee (patch)
tree8c3d1e2eb642b667c9e46babdc786a4d4dc3c789 /lib/api/helpers.rb
parent4d2da5fd2585fead823c4450e54613dadf882c0d (diff)
parentf5860ce6466bf8934bc01254351bffd005dfeafe (diff)
downloadgitlab-ce-7ca6779654ed2da5ba31ab9256406feb1b7fb8ee.tar.gz
Merge branch 'master' of gitlab.com:gitlab-org/gitlab-ce into fix/atom-url-issue
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!