diff options
author | James Lopez <james@jameslopez.es> | 2016-01-29 14:27:10 +0100 |
---|---|---|
committer | James Lopez <james@jameslopez.es> | 2016-01-29 14:27:10 +0100 |
commit | 7ca6779654ed2da5ba31ab9256406feb1b7fb8ee (patch) | |
tree | 8c3d1e2eb642b667c9e46babdc786a4d4dc3c789 /lib/api/helpers.rb | |
parent | 4d2da5fd2585fead823c4450e54613dadf882c0d (diff) | |
parent | f5860ce6466bf8934bc01254351bffd005dfeafe (diff) | |
download | gitlab-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.rb | 5 |
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! |