]> git.openstreetmap.org Git - rails.git/commitdiff
Use flash.now for messages to be shown during this request
authorAndy Allan <git@gravitystorm.co.uk>
Wed, 22 Jan 2025 13:55:30 +0000 (13:55 +0000)
committerAndy Allan <git@gravitystorm.co.uk>
Wed, 22 Jan 2025 13:55:30 +0000 (13:55 +0000)
.rubocop_todo.yml
app/controllers/traces_controller.rb

index fa15ea90a0d5a1ba00019d93f94bc52a157a7fda..3d7cea500fec5826176e028bf5e13d19ec0ae79a 100644 (file)
@@ -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
index 14648dc9c37eea68d78bb9b255ede055cbca15c1..075b5a8649493bc216ba3b84faa6e56df0af015c 100644 (file)
@@ -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