From 5c74d71c947720f37b94e7e2dec7d6f630daf021 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 29 Jun 2019 10:14:46 +0800 Subject: [PATCH] fix bug --- app/helpers/exercises_helper.rb | 2 +- app/views/exercises/_shixun_details.json.jbuilder | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/helpers/exercises_helper.rb b/app/helpers/exercises_helper.rb index 45666d296..5f8683fd0 100644 --- a/app/helpers/exercises_helper.rb +++ b/app/helpers/exercises_helper.rb @@ -436,7 +436,7 @@ module ExercisesHelper game_code = game_challenge code = game_code.try(:new_code) else - code = git_fle_content(exercise_cha.shixun&.repo_path,cha_path) + code = git_fle_content(game.myshixun.repo_path,cha_path) end sx_option = { :exercise_question_id => q.id, diff --git a/app/views/exercises/_shixun_details.json.jbuilder b/app/views/exercises/_shixun_details.json.jbuilder index ac3884336..96e5c6281 100644 --- a/app/views/exercises/_shixun_details.json.jbuilder +++ b/app/views/exercises/_shixun_details.json.jbuilder @@ -29,7 +29,7 @@ json.shixun_detail do if game.try(:lastest_code).blank? cha_path = challenge_path(shixun_challenge.challenge&.path) - latest_code = git_fle_content(shixun_challenge.shixun&.repo_path,cha_path) + latest_code = git_fle_content(game&.myshixun.repo_path,cha_path) else latest_code = game.try(:lastest_code) end