diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index ae1de80..e0813c9 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -49,6 +49,9 @@ class MatchesController < ApplicationController Match.transaction do if @match.update(match_params) handle_match_end if new_state == 'finished' + if @match.group_match? and new_state == "in_progress" + UpdateGroupsGroupScoresAndSave.call(group: @match.group) + end render json: @match else @@ -61,6 +64,7 @@ class MatchesController < ApplicationController private def handle_match_end + UpdateGroupsGroupScoresAndSave.call(group: @match.group) if @match.group_match? return if @match.group_match? if @match.winner.nil?