From 5645883f57853053dd112fb09414dd8c67ffb8cc Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 23 Jul 2019 22:23:26 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A2=98=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- app/controllers/question_banks_controller.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index 84ee9daf2..cfc1c4ba5 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -1597,7 +1597,7 @@ class HomeworkCommonsController < ApplicationController att = attachment.copy att.author_id = homework_bank.user_id att.copy_from = attachment.id - att.attachtype = attachment.attachtype + att.attachtype = attachment.attachtype || 1 homework_bank.attachments << att end homework_bank diff --git a/app/controllers/question_banks_controller.rb b/app/controllers/question_banks_controller.rb index 5ff247729..098c07d1b 100644 --- a/app/controllers/question_banks_controller.rb +++ b/app/controllers/question_banks_controller.rb @@ -154,7 +154,7 @@ class QuestionBanksController < ApplicationController att.container_id = nil att.container_type = nil att.author_id = homework.user_id - att.attachtype = attachment.attachtype + att.attachtype = attachment.attachtype || 1 # att.attachtype = 1 att.copy_from = attachment.id att.save!