优化代码
This commit is contained in:
parent
ff11e4b323
commit
05f1df1922
|
@ -82,10 +82,10 @@ class ZipdownController < ApplicationController
|
||||||
user_zip_paths = homeattaches.map do |homeattach|
|
user_zip_paths = homeattaches.map do |homeattach|
|
||||||
if homeattach.attachments.count > 0
|
if homeattach.attachments.count > 0
|
||||||
zip_homework_by_user homeattach
|
zip_homework_by_user homeattach
|
||||||
has_file = true if has_file == false
|
has_file = true unless has_file
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if has_file == false
|
unless has_file
|
||||||
render file: 'public/no_file_fond.html' , :layout => 'course_base'
|
render file: 'public/no_file_fond.html' , :layout => 'course_base'
|
||||||
end
|
end
|
||||||
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
|
zipping "#{Time.now.to_i}_#{bid.name}.zip", user_zip_paths, OUTPUT_FOLDER
|
||||||
|
|
Loading…
Reference in New Issue