1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-09 23:44:52 +00:00

Fixed bug with pool to bracket advancement. This bug was conceived due to the removing of tests and logic when making pool and pool_placement database fields.

This commit is contained in:
2019-12-12 11:19:24 -05:00
parent a8361593aa
commit e2ec1d4a8a
6 changed files with 71 additions and 21 deletions

View File

@@ -48,8 +48,8 @@ class Weight < ActiveRecord::Base
end
def all_pool_matches_finished(pool)
@wrestlers = wrestlers_in_pool(pool)
@wrestlers.each do |w|
wrestlers = wrestlers_in_pool(pool)
wrestlers.each do |w|
if w.pool_matches.size != w.finished_pool_matches.size
return false
end
@@ -58,14 +58,14 @@ class Weight < ActiveRecord::Base
end
def pools
@wrestlers = self.wrestlers
if @wrestlers.size <= 6
wrestlers = self.wrestlers
if wrestlers.size <= 6
self.pools = 1
elsif (@wrestlers.size > 6) && (@wrestlers.size <= 10)
elsif (wrestlers.size > 6) && (wrestlers.size <= 10)
self.pools = 2
elsif (@wrestlers.size > 10) && (@wrestlers.size <= 16)
elsif (wrestlers.size > 10) && (wrestlers.size <= 16)
self.pools = 4
elsif (@wrestlers.size > 16) && (@wrestlers.size <= 24)
elsif (wrestlers.size > 16) && (wrestlers.size <= 24)
self.pools = 8
end
end