From 55f6da9556391a9676a425256a9ae1048c300e17 Mon Sep 17 00:00:00 2001 From: tkimia Date: Tue, 29 Apr 2014 17:15:06 -0400 Subject: ELIMINATION PROGRESS BIIIIIIIITCH --- app/views/matches/show.html.erb | 1 + lib/scheduling/elimination.rb | 11 ++++------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/views/matches/show.html.erb b/app/views/matches/show.html.erb index 8f6f09c..eaa5c63 100644 --- a/app/views/matches/show.html.erb +++ b/app/views/matches/show.html.erb @@ -82,4 +82,5 @@ <% end %> <% end %> <% end %> + <%= link_to "Back to Tournament", @match.tournament_stage.tournament %> diff --git a/lib/scheduling/elimination.rb b/lib/scheduling/elimination.rb index a95101c..622199c 100644 --- a/lib/scheduling/elimination.rb +++ b/lib/scheduling/elimination.rb @@ -38,9 +38,6 @@ module Scheduling def finish_match(match) require 'pp' - puts('>'*80) - pp match - puts('>'*80) logBase = match.tournament_stage.tournament.min_teams_per_match matches = match.tournament_stage.matches_ordered cur_match_num = matches.invert[match] @@ -48,10 +45,10 @@ module Scheduling match.winner.matches.push(matches[(cur_match_num+logBase-2)/logBase]) end if matches[(cur_match_num+logBase-2)/logBase].teams.count == match.tournament_stage.tournament.min_teams_per_match - puts(80*'><') - puts "making the status 1" - puts(80*'><') - matches[(cur_match_num+logBase-2)/logBase].status = 1 + puts(">"*80) + pp matches[(cur_match_num+logBase-2)/logBase].status + matches[(cur_match_num+logBase-2)/logBase].update(status: 1) + puts(">"*80) end end -- cgit v1.2.3-2-g168b