Fix deprecation: redirect_to :back is deprecated

This commit is contained in:
Jasper Maes 2018-12-17 18:36:09 +01:00
parent bf38936fb3
commit fbdb463580
4 changed files with 8 additions and 3 deletions

View file

@ -77,7 +77,7 @@ class Admin::ApplicationSettingsController < Admin::ApplicationController
def reset_health_check_token
@application_setting.reset_health_check_access_token!
flash[:notice] = 'New health check access token has been generated!'
redirect_to :back
redirect_back_or_default
end
def clear_repository_check_states

View file

@ -76,7 +76,7 @@ class ApplicationController < ActionController::Base
end
def redirect_back_or_default(default: root_path, options: {})
redirect_to request.referer.present? ? :back : default, options
redirect_back(fallback_location: default, **options)
end
def not_found

View file

@ -15,7 +15,7 @@ module Sherlock
def destroy_all
Gitlab::Sherlock.collection.clear
redirect_to :back, status: :found
redirect_back_or_default(options: { status: :found })
end
end
end

View file

@ -0,0 +1,5 @@
---
title: 'Fix deprecation: redirect_to :back is deprecated'
merge_request: 23943
author: Jasper Maes
type: other