From be798dd97ca257e3555603a0bc1bada111d9d051 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Thu, 3 Nov 2022 10:55:20 +0100 Subject: [PATCH] add activestorage base_controller to prevent record not found errors --- app/controllers/active_storage/base_controller.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 app/controllers/active_storage/base_controller.rb diff --git a/app/controllers/active_storage/base_controller.rb b/app/controllers/active_storage/base_controller.rb new file mode 100644 index 000000000..afb2fc376 --- /dev/null +++ b/app/controllers/active_storage/base_controller.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +# The base class for all Active Storage controllers. +class ActiveStorage::BaseController < ActionController::Base + # Controller rewritten to add rescue_from rules + include ApplicationController::WithErrors + include ActiveStorage::SetCurrent + + protect_from_forgery with: :exception + + self.etag_with_template_digest = false +end -- GitLab