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:
authorMatija Čupić <matteeyah@gmail.com>2018-01-23 04:09:36 +0300
committerMatija Čupić <matteeyah@gmail.com>2018-02-05 20:57:43 +0300
commitedbe911b04465f0e6c72e102d083d0e85848a552 (patch)
treeb5aa6c575b78d264d65a4c435deb74571d754f4e /app/controllers/projects
parent5de85708ce17c1965581b8bf7563751dda77510d (diff)
Remove redundant routes in VariablesController
Diffstat (limited to 'app/controllers/projects')
-rw-r--r--app/controllers/projects/variables_controller.rb51
1 files changed, 0 insertions, 51 deletions
diff --git a/app/controllers/projects/variables_controller.rb b/app/controllers/projects/variables_controller.rb
index f916c545fab..8bee1b97d14 100644
--- a/app/controllers/projects/variables_controller.rb
+++ b/app/controllers/projects/variables_controller.rb
@@ -1,37 +1,6 @@
class Projects::VariablesController < Projects::ApplicationController
- before_action :variable, only: [:show, :update, :destroy]
before_action :authorize_admin_build!
- layout 'project_settings'
-
- def index
- redirect_to project_settings_ci_cd_path(@project)
- end
-
- def show
- end
-
- def update
- if variable.update(variable_params)
- redirect_to project_variables_path(project),
- notice: 'Variable was successfully updated.'
- else
- render "show"
- end
- end
-
- def create
- @variable = project.variables.create(variable_params)
- .present(current_user: current_user)
-
- if @variable.persisted?
- redirect_to project_settings_ci_cd_path(project),
- notice: 'Variable was successfully created.'
- else
- render "show"
- end
- end
-
def save_multiple
respond_to do |format|
format.json do
@@ -42,24 +11,8 @@ class Projects::VariablesController < Projects::ApplicationController
end
end
- def destroy
- if variable.destroy
- redirect_to project_settings_ci_cd_path(project),
- status: 302,
- notice: 'Variable was successfully removed.'
- else
- redirect_to project_settings_ci_cd_path(project),
- status: 302,
- notice: 'Failed to remove the variable.'
- end
- end
-
private
- def variable_params
- params.require(:variable).permit(*variable_params_attributes)
- end
-
def variables_params
params.permit(variables_attributes: [*variable_params_attributes])
end
@@ -67,8 +20,4 @@ class Projects::VariablesController < Projects::ApplicationController
def variable_params_attributes
%i[id key value protected _destroy]
end
-
- def variable
- @variable ||= project.variables.find(params[:id]).present(current_user: current_user)
- end
end