diff --git a/app/models/myshixun.rb b/app/models/myshixun.rb index 31cc53200..a4f05f2ce 100644 --- a/app/models/myshixun.rb +++ b/app/models/myshixun.rb @@ -56,7 +56,7 @@ class Myshixun < ApplicationRecord # status:0 可以测评的; 1 正在测评的; 2评测通过的; 3未开启的 # 如果都完成,则当前任务为最后一个任务 def current_task games - current_game = games.select{|game| game.status == 1 || game.status == 0}.first + current_game = games.select{|game| game.status == 1 || game.status == 0}.last if current_game.blank? current_game = games.last end