From b0bee8bc75e2df5d4eff20ff0553c3d11fa55760 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Sat, 22 Jun 2019 16:59:51 +0800 Subject: [PATCH] fix bug --- app/controllers/zips_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/zips_controller.rb b/app/controllers/zips_controller.rb index 41407f876..35373730c 100644 --- a/app/controllers/zips_controller.rb +++ b/app/controllers/zips_controller.rb @@ -40,12 +40,12 @@ class ZipsController < ApplicationController def get_exercise ActiveRecord::Base.transaction do begin - @exercise = Exercise.find_by(id:params[:exercise_id]).includes(:exercise_users) + @exercise = Exercise.includes(:exercise_users).find_by(id:params[:exercise_id]) group_id = params[:exercise_group_id] if @exercise.blank? normal_status(-1,"试卷不存在") else - @course = @exercise.course.includes(:course_members) + @course = @exercise.course default_ex_users = @exercise.all_exercise_users(current_user.id).exercise_user_committed default_ex_users_size = default_ex_users.size