1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-03 21:33:48 +00:00

Added persistence to pool placement and pool order

This commit is contained in:
2019-04-19 10:33:06 -04:00
parent 31fbe5baff
commit a76f4036b3
15 changed files with 766 additions and 585 deletions

View File

@@ -140,7 +140,7 @@ class Weight < ActiveRecord::Base
end
def pool_placement_order(pool)
PoolOrder.new(wrestlers_in_pool(pool)).getPoolOrder
#PoolOrder.new(wrestlers_in_pool(pool)).getPoolOrder
end
def wrestlers_without_pool_assignment

View File

@@ -40,6 +40,10 @@ class Wrestler < ActiveRecord::Base
def total_pool_points_for_pool_order
CalculateWrestlerTeamScore.new(self).poolPoints + CalculateWrestlerTeamScore.new(self).bonusWinPoints
end
def unfinished_pool_matches
unfinished_matches.select{|match| match.finished != 1}
end
def next_match
unfinished_matches.first
@@ -195,6 +199,14 @@ class Wrestler < ActiveRecord::Base
def fastest_pin
pin_wins.sort_by{|m| m.pin_time_in_seconds}.first
end
def pin_time
time = 0
pin_wins.each do | m |
time = time + m.pin_time_in_seconds
end
time
end
def season_win_percentage
win = self.season_win.to_f