summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatija Čupić <matteeyah@gmail.com>2018-02-28 22:19:19 +0100
committerMatija Čupić <matteeyah@gmail.com>2018-02-28 22:19:19 +0100
commit110c9a8ff99b661c88ac54f226c2cdb4ab09830b (patch)
tree4791f236be34226cd6bdd99080dc6cca1c825f4b
parent1442247a8e7fb1e7fb527cd2973f9ab3005e5327 (diff)
downloadgitlab-ce-42930-removing-and-adding-a-variable-gives-an-error-hard-to-understand.tar.gz
-rw-r--r--app/controllers/concerns/ci_variables.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/controllers/concerns/ci_variables.rb b/app/controllers/concerns/ci_variables.rb
index d6f3628ea56..a3c8e940330 100644
--- a/app/controllers/concerns/ci_variables.rb
+++ b/app/controllers/concerns/ci_variables.rb
@@ -9,7 +9,7 @@ module CiVariables
next unless variable
params['variables_attributes'].delete(variable)
- params['variables_attributes'].find { |var| var['key'] == variable['key'] }['id'] = variable['id']
+ params['variables_attributes'].find(variable.merge('id' => '', '_destroy' => '')).each { |var| var['id'] = variable['id'] }
end
end
params