fix: use file_filename field for CarrierWave 3.x compatibility
This commit is contained in:
parent
d7a936157d
commit
fd74947d28
|
|
@ -18,7 +18,7 @@ class BulletinFile
|
|||
end
|
||||
def to_fronted(locale=I18n.locale)
|
||||
file = self
|
||||
(file.enabled_for?(locale) && !file[:file].blank?) ? { "file_url" => "/xhr/announcements/file/#{file.id}/#{file['file']}" + "\" title=\"#{file.file_title}",
|
||||
(file.enabled_for?(locale) && !file[:file_filename].blank?) ? { "file_url" => "/xhr/announcements/file/#{file.id}/#{file['file_filename']}" + "\" title=\"#{file.file_title}",
|
||||
"file_title" => (file.title.blank? ? URI.unescape(File.basename(file.file.path)) : file.title rescue '')
|
||||
} : nil rescue nil
|
||||
end
|
||||
|
|
|
|||
Loading…
Reference in New Issue