优化N+1的问题

dev_aliyun2
daiao 5 years ago committed by harry
parent 86393e925e
commit d44d94194e

@ -80,7 +80,7 @@ class Challenge < ApplicationRecord
# end
def open_game shixun, user_id
game = self.games.where(user_id: user_id).first
game = self.games.map{|g| g.user_id == user_id}.first
if game.present?
shixun.task_pass || game.status != 3 ? "/tasks/#{game.identifier}" : ""
else

Loading…
Cancel
Save