From 322c6c31a5f64f7b200e8a5613f75fa9ef0f40ec Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 22 Jan 2025 13:55:30 +0000 Subject: [PATCH] Use flash.now for messages to be shown during this request --- .rubocop_todo.yml | 13 ------------- app/controllers/traces_controller.rb | 2 +- 2 files changed, 1 insertion(+), 14 deletions(-) diff --git a/.rubocop_todo.yml b/.rubocop_todo.yml index fa15ea90a..3d7cea500 100644 --- a/.rubocop_todo.yml +++ b/.rubocop_todo.yml @@ -106,19 +106,6 @@ Minitest/EmptyLineBeforeAssertionMethods: Minitest/MultipleAssertions: Max: 60 -# Offense count: 10 -# This cop supports unsafe autocorrection (--autocorrect-all). -Rails/ActionControllerFlashBeforeRender: - Exclude: - - 'app/controllers/application_controller.rb' - - 'app/controllers/confirmations_controller.rb' - - 'app/controllers/issue_comments_controller.rb' - - 'app/controllers/messages_controller.rb' - - 'app/controllers/passwords_controller.rb' - - 'app/controllers/traces_controller.rb' - - 'app/controllers/user_blocks_controller.rb' - - 'app/controllers/users_controller.rb' - # Offense count: 2 # Configuration parameters: Include. # Include: app/models/**/*.rb diff --git a/app/controllers/traces_controller.rb b/app/controllers/traces_controller.rb index 14648dc9c..075b5a864 100644 --- a/app/controllers/traces_controller.rb +++ b/app/controllers/traces_controller.rb @@ -116,7 +116,7 @@ class TracesController < ApplicationController @trace.schedule_import redirect_to :action => :index, :display_name => current_user.display_name else - flash[:error] = t(".upload_failed") if @trace.valid? + flash.now[:error] = t(".upload_failed") if @trace.valid? render :action => "new" end -- 2.39.5