1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-02 04:12:18 +00:00

Fixed pooladvance and updated views for when tournament ends

This commit is contained in:
2015-12-04 13:26:32 +00:00
parent ee4239f785
commit c9125527d7
7 changed files with 32 additions and 23 deletions

View File

@@ -157,13 +157,13 @@ class Wrestler < ActiveRecord::Base
end
def seasonWinPercentage
@win = self.season_win.to_f
@loss = self.season_loss.to_f
if @win > 0 and @loss != nil
@matchTotal = @win + @loss
@percentageDec = @win / @matchTotal
@percentage = @percentageDec * 100
return @percentage.to_i
win = self.season_win.to_f
loss = self.season_loss.to_f
if win > 0 and loss != nil
matchTotal = win + loss
percentageDec = win / matchTotal
percentage = percentageDec * 100
return percentage.to_i
elsif self.season_win == 0
return 0
elsif self.season_win == nil or self.season_loss == nil