1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-04 13:43: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

@@ -0,0 +1,5 @@
class AddPoolPlacementToWrestler < ActiveRecord::Migration[5.2]
def change
add_column :wrestlers, :pool_placement, :integer
end
end

View File

@@ -0,0 +1,5 @@
class AddPoolPlacementTiebreakerToWrestler < ActiveRecord::Migration[5.2]
def change
add_column :wrestlers, :pool_placement_tiebreaker, :string
end
end

View File

@@ -0,0 +1,17 @@
class SetPoolPlacementForExistingTournaments < ActiveRecord::Migration[5.2]
def change
Tournament.all.each do | tournament |
tournament.weights.each do | weight |
for pool in (1..weight.pools) do
if weight.all_pool_matches_finished(pool)
PoolOrder.new(weight.wrestlers_in_pool(pool)).getPoolOrder
end
end
end
end
end
end