mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-06 15:40:31 +08:00
Merge pull request #2199 from aignatov-bio/ai-sci-4055-fix-eln-export-for-files-without-extension
Fix eln export for file without extension [SCI-4055]
This commit is contained in:
commit
b979435b35
1 changed files with 6 additions and 1 deletions
|
@ -130,7 +130,12 @@ class TinyMceAsset < ApplicationRecord
|
||||||
if exists?
|
if exists?
|
||||||
order(:id).each do |tiny_mce_asset|
|
order(:id).each do |tiny_mce_asset|
|
||||||
asset_guid = get_guid(tiny_mce_asset.id)
|
asset_guid = get_guid(tiny_mce_asset.id)
|
||||||
asset_file_name = "rte-#{asset_guid}.#{tiny_mce_asset.image.blob.filename.extension}"
|
extension = tiny_mce_asset.image.blob.filename.extension
|
||||||
|
asset_file_name = if extension.empty?
|
||||||
|
"rte-#{asset_guid}"
|
||||||
|
else
|
||||||
|
"rte-#{asset_guid}.#{tiny_mce_asset.image.blob.filename.extension}"
|
||||||
|
end
|
||||||
ostream.put_next_entry("#{dir}/#{asset_file_name}")
|
ostream.put_next_entry("#{dir}/#{asset_file_name}")
|
||||||
ostream.print(tiny_mce_asset.image.download)
|
ostream.print(tiny_mce_asset.image.download)
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue