mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-03-05 04:03:45 +08:00
Require docx template files on initialization [SCI-10999]
This commit is contained in:
parent
c128f2f003
commit
a05c88569b
1 changed files with 3 additions and 1 deletions
|
@ -5,7 +5,7 @@ require 'active_storage/service/s3_service'
|
|||
|
||||
template_zip_url_string = ENV.fetch('REPORT_TEMPLATES_ZIP_URL', nil)
|
||||
|
||||
return unless template_zip_url_string.present?
|
||||
return if template_zip_url_string.blank?
|
||||
|
||||
template_zip_url = URI.parse(template_zip_url_string)
|
||||
contents = case template_zip_url.scheme
|
||||
|
@ -33,5 +33,7 @@ Zip::File.open_buffer(StringIO.new(contents)) do |zip|
|
|||
path.open('wb') do |f|
|
||||
f.write(entry.get_input_stream.read)
|
||||
end
|
||||
|
||||
require path if entry.name.ends_with?('.rb')
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue