summaryrefslogtreecommitdiff
path: root/lib/api/variables.rb
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-07 15:54:39 +0100
committerSean McGivern <sean@gitlab.com>2017-07-07 15:54:39 +0100
commitb8c4d5e0f552dc9986883bd9c8783c7f43f125ce (patch)
tree06478887ace997e9b5735f797ddd64b7f028dc6d /lib/api/variables.rb
parent97611c88fcbae6b025750e6ebf2061a3d87d9753 (diff)
parentc88739ffa6ad99fbd5e20a6e8f2ee251996ea18b (diff)
downloadgitlab-ce-b8c4d5e0f552dc9986883bd9c8783c7f43f125ce.tar.gz
Merge branch 'master' into 33929-allow-to-enable-perf-bar-for-a-group
Diffstat (limited to 'lib/api/variables.rb')
-rw-r--r--lib/api/variables.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/api/variables.rb b/lib/api/variables.rb
index 10374995497..7fa528fb2d3 100644
--- a/lib/api/variables.rb
+++ b/lib/api/variables.rb
@@ -45,7 +45,9 @@ module API
optional :protected, type: String, desc: 'Whether the variable is protected'
end
post ':id/variables' do
- variable = user_project.variables.create(declared_params(include_missing: false))
+ variable_params = declared_params(include_missing: false)
+
+ variable = user_project.variables.create(variable_params)
if variable.valid?
present variable, with: Entities::Variable
@@ -67,7 +69,9 @@ module API
return not_found!('Variable') unless variable
- if variable.update(declared_params(include_missing: false).except(:key))
+ variable_params = declared_params(include_missing: false).except(:key)
+
+ if variable.update(variable_params)
present variable, with: Entities::Variable
else
render_validation_error!(variable)