From 95255749bd4f98eb2c3ddcd55e5df52b67546052 Mon Sep 17 00:00:00 2001 From: cxt <853663049@qq.com> Date: Tue, 2 Jul 2019 11:23:49 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/controllers/homework_commons_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/homework_commons_controller.rb b/app/controllers/homework_commons_controller.rb index aaffc34a6..af1dffe71 100644 --- a/app/controllers/homework_commons_controller.rb +++ b/app/controllers/homework_commons_controller.rb @@ -272,7 +272,7 @@ class HomeworkCommonsController < ApplicationController def update_student_score work = @homework.student_works.find_by(user_id: current_user.id) myshixun = Myshixun.find_by(shixun_id: params[:shixun_id], user_id: current_user.id) - ActiveRecord::Base.transaction do + ActiveRecord::Base.transaction do begin if work && myshixun && (work.update_time.nil? || work.update_time < myshixun.updated_at) challenge_settings = @homework.homework_challenge_settings