You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
pgfqe6ch8/app/helpers/games_helper.rb

16 lines
320 B

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