From 49294a348e4ed428466b2389af96581274c9f195 Mon Sep 17 00:00:00 2001 From: pabois <pierreandre.boissinot@noesya.coop> Date: Thu, 3 Nov 2022 11:21:49 +0100 Subject: [PATCH] update base controller --- app/controllers/active_storage/base_controller.rb | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/app/controllers/active_storage/base_controller.rb b/app/controllers/active_storage/base_controller.rb index afb2fc376..bf0f18f73 100644 --- a/app/controllers/active_storage/base_controller.rb +++ b/app/controllers/active_storage/base_controller.rb @@ -9,4 +9,13 @@ class ActiveStorage::BaseController < ActionController::Base protect_from_forgery with: :exception self.etag_with_template_digest = false + + private + def stream(blob) + blob.download do |chunk| + response.stream.write chunk + end + ensure + response.stream.close + end end -- GitLab