You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When exiting an action early, we often use return redirect_to ..., since the return value doesn't matter, and it saves a line. Unfortunately, this can trigger an offense.
Actual behavior
app/controllers/gradebooks_controller.rb:1038:7: C: Rails/ActionControllerFlashBeforeRender: Use flash.now before render.
flash[:notice] = t(:speed_grader_disabled, "SpeedGrader is disabled for this course")
^^^^^
Steps to reproduce the problem
unless@context.allows_speed_grader?flash[:notice]=t(:speed_grader_disabled,"SpeedGrader is disabled for this course")returnredirect_to(course_gradebook_path(@context))end
Expected behavior
When exiting an action early, we often use
return redirect_to ...
, since the return value doesn't matter, and it saves a line. Unfortunately, this can trigger an offense.Actual behavior
Steps to reproduce the problem
RuboCop version
The text was updated successfully, but these errors were encountered: