1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-13 08:32:47 +00:00

Added before save on wrestler and weight. Also fixed fourPoolNumbers for weight

This commit is contained in:
2015-03-28 18:16:32 +00:00
parent 43d7089b44
commit 9976fd5869
2 changed files with 35 additions and 1 deletions

View File

@@ -2,8 +2,14 @@ class Wrestler < ActiveRecord::Base
belongs_to :school
belongs_to :weight
has_one :tournament, through: :weight
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage, :poolNumber
before_save do
self.tournament.matchups_array = nil
self.tournament.save
end
def isWrestlingThisRound(matchRound)
@gMatches = Match.where(g_id: self.id, round: matchRound)
@rMatches = Match.where(r_id: self.id, round: matchRound)