From 95d2f0fb51de2c5800d41b7c4f285ed533ffe21a Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 26 Jan 2016 19:25:48 +0100 Subject: Fix CI runner version not being properly updated when asking for a build Due to broken implementation of attribute_for_keys the runner information was not updated correctly. This MR adds test to check that such scenario will never happen again. --- lib/api/helpers.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/api/helpers.rb') 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! -- cgit v1.2.1