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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user