summaryrefslogtreecommitdiff
path: root/app/controllers/matches_controller.rb
diff options
context:
space:
mode:
authorAndrewMurrell <amurrel@purdue.edu>2014-04-07 03:28:37 -0400
committerAndrewMurrell <amurrel@purdue.edu>2014-04-07 03:28:37 -0400
commit22d74ce5b34140b353d43a1848fe51eaaa254d84 (patch)
tree77d0444a0015a8281394ef0144618c46067c829a /app/controllers/matches_controller.rb
parent78bdc2e525c52beff4f7fd0d390c3af87bef5257 (diff)
updated matches controller and added hooks
Diffstat (limited to 'app/controllers/matches_controller.rb')
-rw-r--r--app/controllers/matches_controller.rb5
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' }