From 2c9e06946db674b51819c7fd70aa9d2e9909ad42 Mon Sep 17 00:00:00 2001 From: Malaber <32635600+Malaber@users.noreply.github.com> Date: Fri, 10 May 2019 11:44:11 +0200 Subject: [PATCH] Call populate_match_below when a match is finished --- app/controllers/matches_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 0d444fa..1cfc05c 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -14,9 +14,7 @@ class MatchesController < ApplicationController def update new_state = match_params['state'] if new_state == 'finished' - # implement logic to move the winning team into the next stage - match_params['state'] = 'finished' # or 'team2_won' or 'undecided' - render json: {}, status: :not_implemented + PlayoffStageService.populate_match_below(@match) unless @match.group_match? end if @match.update(match_params) render json: @match