1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-07 23:17:25 +00:00

Formatting code and deleting uneeded methods

This commit is contained in:
2015-03-28 14:43:14 +00:00
parent 7b5ffaff29
commit d7bbd32460
2 changed files with 6 additions and 31 deletions

View File

@@ -1,7 +1,7 @@
class Wrestler < ActiveRecord::Base
belongs_to :school
belongs_to :weight
attr_accessor :matches_all, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage, :poolNumber
attr_accessor :allMatches, :isWrestlingThisRound, :boutByRound, :seasonWinPercentage
def isWrestlingThisRound(matchRound)
@gMatches = Match.where(g_id: self.id, round: matchRound)
@@ -28,13 +28,13 @@ class Wrestler < ActiveRecord::Base
return @match.boutNumber
end
end
def matches_all
@gMatches = Match.where(g_id: self.id)
@rMatches = Match.where(r_id: self.id)
return @gMatches + @rMatches
def allMatches(matches)
@matches = matches.select{|m| m.w1 == self.id || m.w2 == self.id}
return @matches
end
def seasonWinPercentage
@win = self.season_win.to_f
@loss = self.season_loss.to_f
@@ -48,7 +48,6 @@ class Wrestler < ActiveRecord::Base
elsif self.season_win == nil or self.season_loss == nil
return 0
end
end
end