fix error

This commit is contained in:
chiu 2021-09-16 17:51:48 +08:00
parent 045de3cc04
commit 3feb7b5dd6
1 changed files with 1 additions and 1 deletions

View File

@ -16,7 +16,7 @@ class EventNewsFile
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].blank?) ? { "file_url" => "/xhr/event_news/file/#{file.id}/#{file['file']}" + "\" title=\"#{file.file_title}",
"file_title" => (file.title.blank? ? URI.unescape(File.basename(file.file.path)) : file.title rescue '')
} : nil rescue nil
end