From 0cc36f2a1babc4ef5524448bf2c48eca68f85412 Mon Sep 17 00:00:00 2001 From: f Date: Fri, 7 Apr 2023 14:24:47 -0300 Subject: [PATCH] =?UTF-8?q?fix:=20actualizar=20la=20informaci=C3=B3n=20y?= =?UTF-8?q?=20guardar=20la=20url=20#12971?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit para evitar que falle el trabajo de anĂ¡lisis --- app/controllers/active_storage/disk_controller_decorator.rb | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/app/controllers/active_storage/disk_controller_decorator.rb b/app/controllers/active_storage/disk_controller_decorator.rb index e49c22f1..3e74fe1b 100644 --- a/app/controllers/active_storage/disk_controller_decorator.rb +++ b/app/controllers/active_storage/disk_controller_decorator.rb @@ -28,7 +28,9 @@ module ActiveStorage begin url = request.body.read body = Down.download(url, max_size: 111.megabytes) - checksum = nil + checksum = Digest::MD5.file(body.path).base64digest + blob.metadata[:url] = url + blob.update_columns checksum: checksum, byte_size: body.size, metadata: blob.metadata rescue StandardError => e ExceptionNotifier.notify_exception(e, data: { key: token[:key], url: url, site: site.name })