diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index c65b521..0d444fa 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -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) diff --git a/app/models/match.rb b/app/models/match.rb index 8b3ba33..8007619 100644 --- a/app/models/match.rb +++ b/app/models/match.rb @@ -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