From d2eb51bbb6f47644d64e156b54c3e8e26535326b Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 3 Jun 2015 18:47:23 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8F=AA=E5=A4=84=E7=90=86=E8=B5=84=E6=BA=90?= =?UTF-8?q?=E5=BA=93=E7=9A=84=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/attachment.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/models/attachment.rb b/app/models/attachment.rb index 1e477ed04..4a6580a7a 100644 --- a/app/models/attachment.rb +++ b/app/models/attachment.rb @@ -259,11 +259,12 @@ class Attachment < ActiveRecord::Base end def office_conver + return unless %w(Project Course).included? (self.container_type) saved_path = File.join(Rails.root, "files", "convered_office") unless Dir.exist?(saved_path) Dir.mkdir(saved_path) end - convered_file = File.join(saved_path, self.disk_filename + ".html") + convered_file = File.join(saved_path, self.disk_filename + ".pdf") OfficeConverTask.new.conver(self.diskfile, convered_file) end