1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-06 14:36:59 +00:00

Updated match generation view, created a bracket_type for weight, and

add DQ as a win type.
This commit is contained in:
2015-02-09 12:31:14 -05:00
parent 399318c6c0
commit 2e7e34125b
3 changed files with 18 additions and 3 deletions

View File

@@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base
belongs_to :tournament
has_many :wrestlers, dependent: :destroy
attr_accessor :pools, :bracket_size
attr_accessor :pools, :bracket_size, :bracket_type
def generatePool
@wrestlers = Wrestler.where(weight_id: self.id)
@@ -35,5 +35,15 @@ class Weight < ActiveRecord::Base
return @wrestlers.size
end
def bracket_type
if self.wrestlers.size > 7 && self.wrestlers.size <= 10
return "twoPoolsToSemi"
elsif self.wrestlers.size == 11
return "fourPoolsToQuarter"
elsif self.wrestlers.size > 11 && self.wrestlers.size <= 16
return "fourPoolsToSemi"
end
self.wrestlers.size
end
end