diff --git a/app/models/challenge.rb b/app/models/challenge.rb index 18b177e1c..e7a382a51 100644 --- a/app/models/challenge.rb +++ b/app/models/challenge.rb @@ -52,7 +52,7 @@ class Challenge < ApplicationRecord # 开启挑战 def open_game user_id, shixun - game = self.games.first + game = self.games.where(user_id: user_id).first if game.present? shixun.task_pass || game.status != 3 ? "/tasks/#{game.identifier}" : "" else