From e4d68e988ea2b95b06d5d842f9369b8aaa5200ce Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Wed, 3 Jun 2015 17:52:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=8A=A0=E4=B8=8Autf8=E5=A4=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 2 +- lib/tasks/office.rake | 2 ++ lib/trustie/utils/office.rb | 2 ++ 3 files changed, 5 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index 9c3b624af..d3781d747 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -73,7 +73,7 @@ class AttachmentsController < ApplicationController if candown || User.current.admin? || User.current.id == @attachment.author_id @attachment.increment_download if stale?(:etag => @attachment.digest) - convered_file = @attachment.disk_filename + convered_file = @attachment.diskfile unless pdf?(convered_file) convered_file = File.join(Rails.root, "files", "convered_office", @attachment.disk_filename + ".pdf") end diff --git a/lib/tasks/office.rake b/lib/tasks/office.rake index ce2d3a221..c6ee8b4dd 100644 --- a/lib/tasks/office.rake +++ b/lib/tasks/office.rake @@ -1,3 +1,5 @@ +#coding=utf-8 + namespace :office do desc "conver any files to html" task :conver => :environment do diff --git a/lib/trustie/utils/office.rb b/lib/trustie/utils/office.rb index adfa3fb5c..61d6b9d4c 100644 --- a/lib/trustie/utils/office.rb +++ b/lib/trustie/utils/office.rb @@ -1,3 +1,5 @@ +#coding=utf-8 + module Trustie module Utils class Office