作业附件的显示和下载

chromesetting
cxt 5 years ago
parent b301628705
commit 977bcb3d4a

@ -38,7 +38,7 @@ class Attachment < ApplicationRecord
if container.is_a?(StudentWork) && author_id != User.current.id
course = container&.homework_common&.course
unless User.current.teacher_of_course?(course)
title = "#{Time.now.strftime('%Y-%m-%d %H:%M:%S')}_#{DCODES.sample(8).join}" + File.extname(filename)
title = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{DCODES.sample(8).join}" + File.extname(filename)
end
end
title

Loading…
Cancel
Save