Reword error on invalid match state

This commit is contained in:
Thor77 2019-06-17 13:25:05 +02:00
parent 175870ab42
commit 914cfbd94d
No known key found for this signature in database
GPG Key ID: 5051E71B46AA669A
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class UserService
raise UserServiceError, 'The given team is not involved in the given match' unless match.teams.include? team raise UserServiceError, 'The given team is not involved in the given match' unless match.teams.include? team
end end
raise UserServiceError, 'This user already created a bet on this match' if match.bets.map(&:user).include? @user raise UserServiceError, 'This user already created a bet on this match' if match.bets.map(&:user).include? @user
raise UserServiceError, "Betting is not supported while match is #{match.state}" \ raise UserServiceError, "Betting is not allowed while match is #{match.state}" \
unless %w[not_ready not_started].include? match.state unless %w[not_ready not_started].include? match.state
end end
end end