From c24072b9313fe0df8a032e183eaf7aa60351c01d Mon Sep 17 00:00:00 2001 From: daiao <358551898@qq.com> Date: Fri, 27 Dec 2019 14:47:34 +0800 Subject: [PATCH] 1 --- app/controllers/hack_user_lastest_codes_controller.rb | 2 +- app/models/hack_user_code.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 2ece96ad5..976317107 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -70,7 +70,7 @@ class HackUserLastestCodesController < ApplicationController # 提交记录详情 def record_detail @hack_user = HackUserCode.find params[:id] - set = HackSet.find_by(error_test_set_id: @hack_user.error_test_set_id) + set = HackSet.find_by(id: @hack_user.error_test_set_id) @pass_set_count = set ? set.position - 1 : 0 @set_count = @hack_user.hack.hack_sets.count @my_hack = @hack_user.hack_user_lastest_code diff --git a/app/models/hack_user_code.rb b/app/models/hack_user_code.rb index eee394e39..1e13f8bfb 100644 --- a/app/models/hack_user_code.rb +++ b/app/models/hack_user_code.rb @@ -1,4 +1,5 @@ class HackUserCode < ApplicationRecord + # error_test_set_id: 错误的测试集id # 用户编程题的信息 belongs_to :hack belongs_to :hack_user_lastest_code