mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-31 21:37:16 +00:00
Store report files on the local disk
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user