diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-02-28 22:19:19 +0100 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-28 22:19:19 +0100 |
commit | 110c9a8ff99b661c88ac54f226c2cdb4ab09830b (patch) | |
tree | 4791f236be34226cd6bdd99080dc6cca1c825f4b | |
parent | 1442247a8e7fb1e7fb527cd2973f9ab3005e5327 (diff) | |
download | gitlab-ce-42930-removing-and-adding-a-variable-gives-an-error-hard-to-understand.tar.gz |
Propagate variable id to all duplicates42930-removing-and-adding-a-variable-gives-an-error-hard-to-understand
-rw-r--r-- | app/controllers/concerns/ci_variables.rb | 2 |
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 |