From 69d5fb522755b300520906f8033b672812a5456c Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Wed, 11 Dec 2019 11:28:35 +0800 Subject: [PATCH] =?UTF-8?q?=E9=99=84=E4=BB=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/attachments_controller.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/app/controllers/attachments_controller.rb b/app/controllers/attachments_controller.rb index dd54e2aae..03b0fcc33 100644 --- a/app/controllers/attachments_controller.rb +++ b/app/controllers/attachments_controller.rb @@ -68,7 +68,7 @@ class AttachmentsController < ApplicationController @attachment.author_id = current_user.id @attachment.disk_directory = month_folder @attachment.cloud_url = remote_path - @attachment.container_id = params[:container_id] + @attachment.container_id = conversion_container_id(params[:container_id], params[:container_type]) @attachment.container_type = params[:container_type] @attachment.attachtype = params[:attachtype] @attachment.save! @@ -215,4 +215,10 @@ class AttachmentsController < ApplicationController end end end + + def conversion_container_id id, type + if type == 'Shixun' + Shixun.find_by_identifier(id).id + end + end end