diff options
author | AndrewMurrell <amurrel@purdue.edu> | 2014-04-07 03:28:37 -0400 |
---|---|---|
committer | AndrewMurrell <amurrel@purdue.edu> | 2014-04-07 03:28:37 -0400 |
commit | 22d74ce5b34140b353d43a1848fe51eaaa254d84 (patch) | |
tree | 77d0444a0015a8281394ef0144618c46067c829a /app | |
parent | 78bdc2e525c52beff4f7fd0d390c3af87bef5257 (diff) |
updated matches controller and added hooks
Diffstat (limited to 'app')
-rw-r--r-- | app/controllers/matches_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
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' } |