Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinya Maeda <shinya@gitlab.com>2017-07-06 14:10:07 +0300
committerShinya Maeda <shinya@gitlab.com>2017-07-07 09:35:12 +0300
commit8c434a52fcfc92ffbd8bf9aa5ee2893724d3c666 (patch)
treedf3061c2d0cbbc4797e57cbe1c08f620a0950faf /app/controllers/projects/variables_controller.rb
parent61d5b13888e9eb83cd86ca9849034d320b94d2b7 (diff)
gb nice catches
Diffstat (limited to 'app/controllers/projects/variables_controller.rb')
-rw-r--r--app/controllers/projects/variables_controller.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index 04d7429d939..e8dcfa92348 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -21,13 +21,13 @@ class Projects::VariablesController < Projects::ApplicationController
end
def create
- new_variable = project.variables.create(project_params)
+ @variable = project.variables.create(project_params)
+ .present(current_user: current_user)
- if new_variable.persisted?
+ if @variable.persisted?
redirect_to project_settings_ci_cd_path(project),
- notice: 'Variables were successfully updated.'
+ notice: 'Variable was successfully created.'
else
- @variable = new_variable.present(current_user: current_user)
render "show"
end
end
@@ -40,7 +40,7 @@ class Projects::VariablesController < Projects::ApplicationController
else
redirect_to namespace_project_settings_ci_cd_path(project.namespace, project),
status: 302,
- notice: 'Failed to remove the variable'
+ notice: 'Failed to remove the variable.'
end
end