需要迁移的预览文件优化

This commit is contained in:
guange 2015-06-03 18:30:49 +08:00
parent 3cc6fc1a64
commit f86acbb10f
1 changed files with 2 additions and 2 deletions

View File

@ -3,9 +3,9 @@
namespace :office do
desc "conver any files to html"
task :conver => :environment do
all_count = Attachment.count
all_count = Attachment.where(["container_type IN (?)", %w(Project Course)]).count
i = 0
Attachment.find_each do |a|
Attachment.where(["container_type IN (?)", %w(Project Course)]).find_each do |a|
i += 1
puts "process [#{i}/#{all_count}] => id #{a.id}"
saved_path = File.join(Rails.root, "files", "convered_office")