module GamesHelper def game_final_score myshixun, game if myshixun.shixun.status <= 1 || (game.final_score != 0 && game.answer_open?) gold = 0 else if game.answer_open? && game.final_score ==0 gold = -game.challenge.try(:score).to_i else gold = game.final_score.to_i end end end end