1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-03 12:43:36 +00:00

Wrestler pool number is now saved in db. Pool number generation moved to it's own class.

This commit is contained in:
2017-03-02 18:11:21 +00:00
parent 8fa529dc5f
commit 3f72a912b6
12 changed files with 177 additions and 106 deletions

View File

@@ -4,7 +4,7 @@ class Wrestler < ActiveRecord::Base
has_one :tournament, through: :weight
has_many :matches, through: :weight
has_many :deductedPoints, class_name: "Teampointadjust"
attr_accessor :poolNumber, :poolAdvancePoints, :originalId, :swapId
attr_accessor :poolAdvancePoints, :originalId, :swapId
validates :name, :weight_id, :school_id, presence: true
@@ -103,10 +103,6 @@ class Wrestler < ActiveRecord::Base
end
end
def generatePoolNumber
self.weight.returnPoolNumber(self)
end
def boutByRound(round)
round_match = allMatches.select{|m| m.round == round}.first
if round_match.blank?
@@ -122,7 +118,7 @@ class Wrestler < ActiveRecord::Base
def poolMatches
pool_matches = allMatches.select{|m| m.bracket_position == "Pool"}
pool_matches.select{|m| m.poolNumber == self.generatePoolNumber}
pool_matches.select{|m| m.poolNumber == self.pool}
end
def hasAPoolBye