From 53b60a6b1eb5ddb24015bf7c5b737b794ee75ca9 Mon Sep 17 00:00:00 2001 From: Martin Artnik Date: Mon, 4 Nov 2024 13:54:18 +0100 Subject: [PATCH] Fix generation of docx report preview [SCI-11227] --- app/services/pdf_preview_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/services/pdf_preview_service.rb b/app/services/pdf_preview_service.rb index dce368ea2..cb12e2159 100644 --- a/app/services/pdf_preview_service.rb +++ b/app/services/pdf_preview_service.rb @@ -31,7 +31,7 @@ class PdfPreviewService end ActiveRecord::Base.no_touching do - attached.attach(io: File.open(preview_file), filename: "#{@blob.filename.base}.pdf") + @attached.attach(io: File.open(preview_file), filename: "#{@blob.filename.base}.pdf") end Rails.logger.info("Finished preparing PDF preview for file #{@blob.filename.sanitized}.") end