评论不显示的错误
This commit is contained in:
parent
1574659667
commit
a72675cf1a
|
@ -38,14 +38,15 @@ class Attachment < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def title
|
def title
|
||||||
title = filename
|
filename
|
||||||
if container && container.is_a?(StudentWork) && author_id != User.current.id
|
# title = filename
|
||||||
course = container&.homework_common&.course
|
# if container && container.is_a?(StudentWork) && author_id != User.current.id
|
||||||
unless User.current.teacher_of_course?(course)
|
# course = container&.homework_common&.course
|
||||||
title = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{DCODES.sample(8).join}" + File.extname(filename)
|
# unless User.current.teacher_of_course?(course)
|
||||||
end
|
# title = "#{Time.now.strftime('%Y%m%d%H%M%S')}_#{DCODES.sample(8).join}" + File.extname(filename)
|
||||||
end
|
# end
|
||||||
title
|
# end
|
||||||
|
# title
|
||||||
end
|
end
|
||||||
|
|
||||||
def downloads_count
|
def downloads_count
|
||||||
|
|
Loading…
Reference in New Issue