Store report files on the local disk

This commit is contained in:
Maikel Linke
2023-10-12 17:43:47 +11:00
committed by Konrad
parent 20af19c912
commit eaff1ed921

View File

@@ -11,6 +11,7 @@ class ReportBlob < ActiveStorage::Blob
filename:,
content_type: content_type(filename),
identify: false,
service_name:,
)
end
@@ -18,6 +19,14 @@ class ReportBlob < ActiveStorage::Blob
MIME::Types.of(filename).first&.to_s || "application/octet-stream"
end
def self.service_name
if Rails.env.test?
:test
else
:local
end
end
def result
@result ||= download.force_encoding(Encoding::UTF_8)
end