summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortkimia <tkimia@purdue.edu>2014-04-29 17:15:06 -0400
committertkimia <tkimia@purdue.edu>2014-04-29 17:15:06 -0400
commit55f6da9556391a9676a425256a9ae1048c300e17 (patch)
tree5f18c23c90f2cc34c193dbf043a3461991bc9b47
parenta9d074228774e868ccfc0579813827147c4ed876 (diff)
ELIMINATION PROGRESS BIIIIIIIITCH
-rw-r--r--app/views/matches/show.html.erb1
-rw-r--r--lib/scheduling/elimination.rb11
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 %>
</div>
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