From 5ab3cd6bc47516d3e1babf7c9e38a3b6107e11c5 Mon Sep 17 00:00:00 2001 From: SylorHuang Date: Fri, 23 Aug 2019 11:21:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=B8=8B=E8=AF=95=E5=8D=B719?= =?UTF-8?q?36=E7=9A=84=E8=BF=81=E7=A7=BB=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- db/migrate/20190823023738_change_exericse_1936_scores.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/db/migrate/20190823023738_change_exericse_1936_scores.rb b/db/migrate/20190823023738_change_exericse_1936_scores.rb index 202909276..d1fab00f3 100644 --- a/db/migrate/20190823023738_change_exericse_1936_scores.rb +++ b/db/migrate/20190823023738_change_exericse_1936_scores.rb @@ -3,7 +3,7 @@ class ChangeExericse1936Scores < ActiveRecord::Migration[5.2] #1936的试卷成绩有问题。 # #https://www.educoder.net/courses/2935/exercises/1936/users/pizfnr5ts ex_special = Exercise.find_by_id(1936) - ex_special_users = ex_special.exercise_users.exercise_user_committed.where("end_at is not null and end_at > ?",Time.now - 2.months) + ex_special_users = ex_special&.exercise_users&.exercise_user_committed&.where("end_at is not null and end_at > ?",Time.now - 2.months) if ex_special.present? && ex_special_users.exists? ex_special_users.each do |ex_user| calculate_score = calculate_student_score(ex_special,ex_user.user)[:total_score]