1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-05-06 22:37:33 +00:00

Cleaned up a bunch of shit. Depricated model methods and controller methods.

This commit is contained in:
2015-04-15 13:42:12 +00:00
parent 451e6911f8
commit 2b1618c69b
9 changed files with 45 additions and 51 deletions

View File

@@ -11,10 +11,7 @@ class Wrestler < ActiveRecord::Base
def isWrestlingThisRound(matchRound)
@gMatches = Match.where(g_id: self.id, round: matchRound)
@rMatches = Match.where(r_id: self.id, round: matchRound)
@allMatches = @gMatches + @rMatches
if @gMatches.blank? and @rMatches.blank?
if allMatches(self.tournament.upcomingMatches).blank?
return false
else
return true
@@ -27,8 +24,7 @@ class Wrestler < ActiveRecord::Base
end
def boutByRound(round,matches)
@matches = matches.select{|m| m.w1 == self.id || m.w2 == self.id}
@match = @matches.select{|m| m.round == round}.first
@match = allMatches(matches).select{|m| m.round == round}.first
if @match.blank?
return "BYE"
else
@@ -56,5 +52,4 @@ class Wrestler < ActiveRecord::Base
return 0
end
end
end