From 22d74ce5b34140b353d43a1848fe51eaaa254d84 Mon Sep 17 00:00:00 2001 From: AndrewMurrell Date: Mon, 7 Apr 2014 03:28:37 -0400 Subject: updated matches controller and added hooks --- app/controllers/matches_controller.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'app/controllers/matches_controller.rb') diff --git a/app/controllers/matches_controller.rb b/app/controllers/matches_controller.rb index 97b8b83..fc44e35 100644 --- a/app/controllers/matches_controller.rb +++ b/app/controllers/matches_controller.rb @@ -207,7 +207,10 @@ class MatchesController < ApplicationController base_score = next_score next_score += base_score end - @match.status = 3 + @match.submitted_peer_reviews += 1 + if (@match.submitted_peer_reviews == @match.players.count) + @match.status = 3 + end respond_to do |format| if @match.save format.html { redirect_to tournament_match_path(@tournament, @match), notice: 'Peer Review Submitted' } -- cgit v1.2.3