mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-18 21:42:16 +00:00
Added weight_max to matchup
This commit is contained in:
@@ -1,10 +1,5 @@
|
|||||||
class Matchup
|
class Matchup
|
||||||
attr_accessor :w1, :w2, :round, :weight_id, :boutNumber, :w1_name, :w2_name, :bracket_position, :bracket_position_number
|
attr_accessor :w1, :w2, :round, :weight_id, :boutNumber, :w1_name, :w2_name, :bracket_position, :bracket_position_number, :weight_max
|
||||||
|
|
||||||
def weight_max
|
|
||||||
@weight = Weight.find(self.weight_id)
|
|
||||||
return @weight.max
|
|
||||||
end
|
|
||||||
|
|
||||||
def to_hash
|
def to_hash
|
||||||
hash = {}
|
hash = {}
|
||||||
|
|||||||
@@ -23,6 +23,7 @@ class Pool
|
|||||||
@match.w2_name = b[1].name
|
@match.w2_name = b[1].name
|
||||||
@match.weight_id = weight.id
|
@match.weight_id = weight.id
|
||||||
@match.round = index + 1
|
@match.round = index + 1
|
||||||
|
@match.weight_max = weight.max
|
||||||
matches << @match
|
matches << @match
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -95,6 +95,7 @@ class Poolbracket
|
|||||||
@match.round = round
|
@match.round = round
|
||||||
@match.bracket_position = bracket_position
|
@match.bracket_position = bracket_position
|
||||||
@match.bracket_position_number = bracket_position_number
|
@match.bracket_position_number = bracket_position_number
|
||||||
|
@match.weight_max = weight.max
|
||||||
matches << @match
|
matches << @match
|
||||||
return matches
|
return matches
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ class Tournament < ActiveRecord::Base
|
|||||||
end
|
end
|
||||||
|
|
||||||
def upcomingMatches
|
def upcomingMatches
|
||||||
if self.matchups_array?
|
if self.matchups_array
|
||||||
return matchupHashesToObjects(self.matchups_array)
|
return matchupHashesToObjects(self.matchups_array)
|
||||||
else
|
else
|
||||||
@matches = generateMatchups
|
@matches = generateMatchups
|
||||||
|
|||||||
Reference in New Issue
Block a user