mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-25 23:50:45 +00:00
Simplify construction a bit on some methods
This commit is contained in:
@@ -3,23 +3,22 @@ class Wrestler < ActiveRecord::Base
|
||||
belongs_to :weight
|
||||
has_one :tournament, through: :weight
|
||||
attr_accessor :poolNumber
|
||||
|
||||
|
||||
before_save do
|
||||
self.tournament.destroyAllMatches
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
def isWrestlingThisRound(matchRound)
|
||||
if allMatches.blank?
|
||||
return false
|
||||
else
|
||||
return true
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def generatePoolNumber
|
||||
@pool = self.weight.returnPoolNumber(self)
|
||||
return @pool
|
||||
end
|
||||
|
||||
def boutByRound(round,matches)
|
||||
@@ -30,7 +29,7 @@ class Wrestler < ActiveRecord::Base
|
||||
return @match.bout_number
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
def allMatches
|
||||
@matches = Match.where("w1 = ? or w2 = ?",self.id,self.id)
|
||||
return @matches
|
||||
@@ -48,7 +47,7 @@ class Wrestler < ActiveRecord::Base
|
||||
elsif self.season_win == 0
|
||||
return 0
|
||||
elsif self.season_win == nil or self.season_loss == nil
|
||||
return 0
|
||||
return 0
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user