mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-10 23:53:06 +00:00
Cleaned up a little bit of code
This commit is contained in:
@@ -5,7 +5,7 @@ class Tournament < ActiveRecord::Base
|
|||||||
has_many :mats, dependent: :destroy
|
has_many :mats, dependent: :destroy
|
||||||
attr_accessor :upcomingMatches, :unfinishedMatches
|
attr_accessor :upcomingMatches, :unfinishedMatches
|
||||||
|
|
||||||
def self.unfinishedMatches
|
def unfinishedMatches
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -102,16 +102,8 @@ class Weight < ActiveRecord::Base
|
|||||||
|
|
||||||
def generateMatchups(matches)
|
def generateMatchups(matches)
|
||||||
@wrestlers = self.wrestlers
|
@wrestlers = self.wrestlers
|
||||||
if self.pools == 1
|
@pool = Pool.new
|
||||||
@pool = Pool.new
|
@matches = @pool.generatePools(self.pools,@wrestlers,self,self.tournament_id,matches)
|
||||||
@matches = @pool.generatePools(1,@wrestlers,self,self.tournament_id,matches)
|
|
||||||
elsif self.pools == 2
|
|
||||||
@pool = Pool.new
|
|
||||||
@matches = @pool.generatePools(2,@wrestlers,self,self.tournament_id,matches)
|
|
||||||
elsif self.pools == 4
|
|
||||||
@pool = Pool.new
|
|
||||||
@matches = @pool.generatePools(4,@wrestlers,self,self.tournament_id,matches)
|
|
||||||
end
|
|
||||||
return @matches
|
return @matches
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user