From 8ad24ce770583204ca4ae5802f5049b9bf931718 Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 27 Dec 2019 20:08:32 +0800 Subject: [PATCH] =?UTF-8?q?=E9=93=BE=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/views/hack_user_lastest_codes/show.json.jbuilder | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/views/hack_user_lastest_codes/show.json.jbuilder b/app/views/hack_user_lastest_codes/show.json.jbuilder index f866b3151..04b066aa0 100644 --- a/app/views/hack_user_lastest_codes/show.json.jbuilder +++ b/app/views/hack_user_lastest_codes/show.json.jbuilder @@ -1,8 +1,8 @@ json.hack do json.(@hack, :id, :name, :difficult, :time_limit, :description, :score, :identifier, :status, :praises_count) json.language @hack.language - json.username @hack.user.real_name - json.user_path "/users/#{@hack.user.login}" + json.username @hack.user&.real_name + json.user_path "/users/#{@hack.user&.login}" json.code @my_hack.code json.pass_count @hack.pass_num json.submit_count @hack.submit_num