From 2fe3752aa78a84499ae5cbe51d4853693a4ada2f Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Sat, 11 Jan 2020 14:34:39 +0800 Subject: [PATCH] =?UTF-8?q?rake=E4=BB=BB=E5=8A=A1=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/tasks/sync_trustie_program_question.rake | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/tasks/sync_trustie_program_question.rake b/lib/tasks/sync_trustie_program_question.rake index a544cff45..cd214e438 100644 --- a/lib/tasks/sync_trustie_program_question.rake +++ b/lib/tasks/sync_trustie_program_question.rake @@ -24,7 +24,7 @@ namespace :sync_program do end end # 新建知识点 - hack_code_params = {code: Base64.encode64(program.standard_code), language: program.oj_language} + hack_code_params = {code: program.standard_code.blank? ? nil : Base64.encode64(program.standard_code), language: program.oj_language} hack_codes = hack.hack_codes.new(hack_code_params) hack_codes.modify_time = Time.now hack_codes.save!