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")