From f86acbb10f08b99175f722536476a54209dcde05 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 3 Jun 2015 18:30:49 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9C=80=E8=A6=81=E8=BF=81=E7=A7=BB=E7=9A=84?= =?UTF-8?q?=E9=A2=84=E8=A7=88=E6=96=87=E4=BB=B6=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/office.rake | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/tasks/office.rake b/lib/tasks/office.rake index c6ee8b4dd..8bfc0c0ea 100644 --- a/lib/tasks/office.rake +++ b/lib/tasks/office.rake @@ -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")