diff --git a/app/models/poolbracket.rb b/app/models/poolbracket.rb
index 0f516b8..8be5629 100644
--- a/app/models/poolbracket.rb
+++ b/app/models/poolbracket.rb
@@ -15,21 +15,21 @@ class Poolbracket
def twoPoolsToSemi(matches,weight,round)
@round = round + 1
- matches = createMatchup(matches,weight,@round,"Winner Pool 1","Runner Up Pool 2","Semis",nil)
- matches = createMatchup(matches,weight,@round,"Winner Pool 2","Runner Up Pool 1","Semis",nil)
+ matches = createMatchup(matches,weight,@round,"Winner Pool 1","Runner Up Pool 2","Semis",1)
+ matches = createMatchup(matches,weight,@round,"Winner Pool 2","Runner Up Pool 1","Semis",2)
matches = assignBouts(matches)
@round = @round + 1
@matches = matches.select{|m| m.weight_id == weight.id}
@match1 = @matches.select{|m| m.w1_name == "Winner Pool 1"}.first
@match2 = @matches.select{|m| m.w1_name == "Winner Pool 2"}.first
- matches = createMatchup(matches,weight,@round,"","","1/2",nil)
- matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","3/4",nil)
+ matches = createMatchup(matches,weight,@round,"","","1/2",1)
+ matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","3/4",1)
end
def twoPoolsToFinal(matches,weight,round)
@round = round + 1
- matches = createMatchup(matches,weight,@round,"Winner Pool 1","Winner Pool 2","1/2",nil)
- matches = createMatchup(matches,weight,@round,"Runner Up Pool 1","Runner Up Pool 2","3/4",nil)
+ matches = createMatchup(matches,weight,@round,"Winner Pool 1","Winner Pool 2","1/2",1)
+ matches = createMatchup(matches,weight,@round,"Runner Up Pool 1","Runner Up Pool 2","3/4",1)
end
def fourPoolsToQuarter(matches,weight,round)
@@ -56,33 +56,33 @@ class Poolbracket
@match1 = @match.select{|m|m.bracket_position_number == 1}.first
@match = @matches.select{|m| m.bracket_position == "Semis"}
@match2 = @match.select{|m|m.bracket_position_number == 2}.first
- matches = createMatchup(matches,weight,@round,"","","1/2",nil)
- matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","3/4",nil)
+ matches = createMatchup(matches,weight,@round,"","","1/2",1)
+ matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","3/4",1)
@match = @matches.select{|m| m.bracket_position == "Conso Semis"}
@match1 = @match.select{|m|m.bracket_position_number == 1}.first
@match = @matches.select{|m| m.bracket_position == "Conso Semis"}
@match2 = @match.select{|m|m.bracket_position_number == 2}.first
- matches = createMatchup(matches,weight,@round,"","","5/6",nil)
- matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","7/8",nil)
+ matches = createMatchup(matches,weight,@round,"","","5/6",1)
+ matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","7/8",1)
end
def fourPoolsToSemi(matches,weight,round)
@round = round + 1
- matches = createMatchup(matches,weight,@round,"Winner Pool 1","Winner Pool 4","Semis",nil)
- matches = createMatchup(matches,weight,@round,"Winner Pool 2","Winner Pool 3","Semis",nil)
- matches = createMatchup(matches,weight,@round,"Runner Up Pool 1","Runner Up Pool 4","Conso Semis",nil)
- matches = createMatchup(matches,weight,@round,"Runner Up Pool 2","Runner Up Pool 3","Conso Semis",nil)
+ matches = createMatchup(matches,weight,@round,"Winner Pool 1","Winner Pool 4","Semis",1)
+ matches = createMatchup(matches,weight,@round,"Winner Pool 2","Winner Pool 3","Semis",2)
+ matches = createMatchup(matches,weight,@round,"Runner Up Pool 1","Runner Up Pool 4","Conso Semis",1)
+ matches = createMatchup(matches,weight,@round,"Runner Up Pool 2","Runner Up Pool 3","Conso Semis",2)
matches = assignBouts(matches)
@round = @round + 1
@matches = matches.select{|m| m.weight_id == weight.id}
- matches = createMatchup(matches,weight,@round,"","","1/2",nil)
+ matches = createMatchup(matches,weight,@round,"","","1/2",1)
@match1 = @matches.select{|m| m.w1_name == "Winner Pool 1"}.first
@match2 = @matches.select{|m| m.w1_name == "Winner Pool 2"}.first
- matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","3/4",nil)
- matches = createMatchup(matches,weight,@round,"","","5/6",nil)
+ matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","3/4",1)
+ matches = createMatchup(matches,weight,@round,"","","5/6",1)
@match1 = @matches.select{|m| m.w1_name == "Runner Up Pool 1"}.first
@match2 = @matches.select{|m| m.w1_name == "Runner Up Pool 2"}.first
- matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","7/8",nil)
+ matches = createMatchup(matches,weight,@round,"Loser of #{@match1.boutNumber}","Loser of #{@match2.boutNumber}","7/8",1)
return matches
end
diff --git a/app/views/static_pages/_fourPoolQuarterBracket.html.erb b/app/views/static_pages/_fourPoolQuarterBracket.html.erb
index 8ef185b..6bbe600 100644
--- a/app/views/static_pages/_fourPoolQuarterBracket.html.erb
+++ b/app/views/static_pages/_fourPoolQuarterBracket.html.erb
@@ -74,7 +74,7 @@ li.game{
<% end %>
- <% @matches.select{|m|m.bracket_position == "Semis"}.each do |match| %>
+ <% @matches.select{|m|m.bracket_position == "Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
-
- <%= match.w1_name %> Score
@@ -136,7 +136,7 @@ li.game{
Consolation Bracket After Pool
- <% @matches.select{|m|m.bracket_position == "Conso Semis"}.each do |match| %>
+ <% @matches.select{|m|m.bracket_position == "Conso Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
-
- <%= match.w1_name %> Score
diff --git a/app/views/static_pages/_fourPoolSemiBracket.html.erb b/app/views/static_pages/_fourPoolSemiBracket.html.erb
index 6b25baf..476b914 100644
--- a/app/views/static_pages/_fourPoolSemiBracket.html.erb
+++ b/app/views/static_pages/_fourPoolSemiBracket.html.erb
@@ -62,7 +62,7 @@ li.game{
Championship Bracket After Pool
- <% @matches.select{|m|m.bracket_position == "Semis"}.each do |match| %>
+ <% @matches.select{|m|m.bracket_position == "Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
-
- <%= match.w1_name %> Score
@@ -127,7 +127,7 @@ li.game{
Consolation Bracket After Pool
- <% @matches.select{|m|m.bracket_position == "Conso Semis"}.each do |match| %>
+ <% @matches.select{|m|m.bracket_position == "Conso Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
-
- <%= match.w1_name %> Score
diff --git a/app/views/static_pages/_twoPoolSemiBracket.html.erb b/app/views/static_pages/_twoPoolSemiBracket.html.erb
index cee3580..413745e 100644
--- a/app/views/static_pages/_twoPoolSemiBracket.html.erb
+++ b/app/views/static_pages/_twoPoolSemiBracket.html.erb
@@ -62,7 +62,7 @@ li.game{
Championship Bracket After Pool
- <% @matches.select{|m|m.bracket_position == "Semis"}.each do |match| %>
+ <% @matches.select{|m|m.bracket_position == "Semis"}.sort_by{|m| m.bracket_position_number}.each do |match| %>
-
- <%= match.w1_name %> Score