Change status of Match to only represent being finished
The winner will be a attribute of the Match instead of something that is written in its status.
This commit is contained in:
parent
c93af46072
commit
a812e7103d
|
|
@ -15,7 +15,7 @@ class MatchesController < ApplicationController
|
|||
new_state = match_params['state']
|
||||
if new_state == 'finished'
|
||||
# implement logic to move the winning team into the next stage
|
||||
match_params['state'] = 'team1_won' # or 'team2_won' or 'undecided'
|
||||
match_params['state'] = 'finished' # or 'team2_won' or 'undecided'
|
||||
render json: {}, status: :not_implemented
|
||||
end
|
||||
if @match.update(match_params)
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Match < ApplicationRecord
|
||||
enum state: %i[single_team not_ready not_started in_progress team1_won team2_won undecided]
|
||||
enum state: %i[single_team not_ready not_started in_progress finished undecided]
|
||||
|
||||
belongs_to :stage, optional: true
|
||||
belongs_to :group, optional: true
|
||||
|
|
|
|||
Loading…
Reference in New Issue