Fix deprecation: redirect_to :back is deprecated
This commit is contained in:
parent
bf38936fb3
commit
fbdb463580
4 changed files with 8 additions and 3 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
5
changelogs/unreleased/deprecated-redirect-back.yml
Normal file
5
changelogs/unreleased/deprecated-redirect-back.yml
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
title: 'Fix deprecation: redirect_to :back is deprecated'
|
||||
merge_request: 23943
|
||||
author: Jasper Maes
|
||||
type: other
|
Loading…
Reference in a new issue