diff options
author | Matija Čupić <matteeyah@gmail.com> | 2018-01-23 21:34:06 +0300 |
---|---|---|
committer | Matija Čupić <matteeyah@gmail.com> | 2018-02-05 20:58:17 +0300 |
commit | dcc23530bd1e2bd1600bd523c90c040f84f8c354 (patch) | |
tree | 34b4bb95fc9ca9b5c93e772bbb574343a4628d7d /app/controllers | |
parent | cc2bed9283039db726f42184ea635f057534205f (diff) |
Remove redundant routes in Groups::VariablesController
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/groups/variables_controller.rb | 49 |
1 files changed, 0 insertions, 49 deletions
diff --git a/app/controllers/groups/variables_controller.rb b/app/controllers/groups/variables_controller.rb index 3c303b64b65..5fbf532b98e 100644 --- a/app/controllers/groups/variables_controller.rb +++ b/app/controllers/groups/variables_controller.rb @@ -1,36 +1,7 @@ module Groups class VariablesController < Groups::ApplicationController - before_action :variable, only: [:show, :update, :destroy] before_action :authorize_admin_build! - def index - redirect_to group_settings_ci_cd_path(group) - end - - def show - end - - def update - if variable.update(variable_params) - redirect_to group_variables_path(group), - notice: 'Variable was successfully updated.' - else - render "show" - end - end - - def create - @variable = group.variables.create(variable_params) - .present(current_user: current_user) - - if @variable.persisted? - redirect_to group_settings_ci_cd_path(group), - notice: 'Variable was successfully created.' - else - render "show" - end - end - def save_multiple respond_to do |format| format.json do @@ -41,24 +12,8 @@ module Groups end end - def destroy - if variable.destroy - redirect_to group_settings_ci_cd_path(group), - status: 302, - notice: 'Variable was successfully removed.' - else - redirect_to group_settings_ci_cd_path(group), - 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,10 +22,6 @@ module Groups %i[id key value protected _destroy] end - def variable - @variable ||= group.variables.find(params[:id]).present(current_user: current_user) - end - def authorize_admin_build! return render_404 unless can?(current_user, :admin_build, group) end |