From 50817c3d641c29207ed1c3b565c85dcf82e10767 Mon Sep 17 00:00:00 2001 From: sw <939547590@qq.com> Date: Tue, 22 Sep 2015 16:52:21 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BC=96=E8=AF=91=E9=94=99=E8=AF=AF=E6=97=B6?= =?UTF-8?q?=20=E8=AE=A1=E7=AE=97=E7=B3=BB=E7=BB=9F=E8=AF=84=E5=88=86?= =?UTF-8?q?=E4=B8=8D=E6=AD=A3=E7=A1=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/models/student_work_test.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/models/student_work_test.rb b/app/models/student_work_test.rb index 1cfb7f8b2..0246ecabf 100644 --- a/app/models/student_work_test.rb +++ b/app/models/student_work_test.rb @@ -45,7 +45,7 @@ class StudentWorkTest < ActiveRecord::Base private def get_success_count self.results.inject(0) do |sum, result| - sum += (result["status"].to_i == 0 ? 1 : 0) + sum += (result["status"] && result["status"].to_i == 0 ? 1 : 0) end || 0 end