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