From 7b8c7f4ff5461ed19790d620d0a730ac01a2f6f7 Mon Sep 17 00:00:00 2001 From: Daniel O'Connor Date: Thu, 23 Apr 2026 12:15:30 +0000 Subject: [PATCH] Rubocop: Rails/RedirectBackOrTo --- .rubocop_todo.yml | 6 ------ app/controllers/follows_controller.rb | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index 084e16672..54e742226 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -692,12 +692,6 @@ Rails/RakeEnvironment: - 'lib/tasks/i18n.rake' - 'lib/tasks/testing.rake' -# Offense count: 1 -# This cop supports safe autocorrection (--autocorrect). -Rails/RedirectBackOrTo: - Exclude: - - 'app/controllers/follows_controller.rb' - # Offense count: 9 # This cop supports unsafe autocorrection (--autocorrect-all). # Configuration parameters: AllowedReceivers. diff --git a/app/controllers/follows_controller.rb b/app/controllers/follows_controller.rb index d3b75be59..35bc3199f 100644 --- a/app/controllers/follows_controller.rb +++ b/app/controllers/follows_controller.rb @@ -17,7 +17,7 @@ class FollowsController < ApplicationController else flash[:error] = "Already following or error while following." end - redirect_back fallback_location: root_path + redirect_back_or_to(root_path) end def destroy