mirror of
https://github.com/jcwimer/wrestlingApp
synced 2026-04-09 07:39:06 +00:00
Updated match generation view, created a bracket_type for weight, and
add DQ as a win type.
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
class Match < ActiveRecord::Base
|
class Match < ActiveRecord::Base
|
||||||
belongs_to :tournament
|
belongs_to :tournament
|
||||||
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default"]
|
WIN_TYPES = ["Decision", "Major", "Tech Fall", "Pin", "Forfeit", "Injury Default", "Default", "DQ"]
|
||||||
attr_accessor :weight_max
|
attr_accessor :weight_max
|
||||||
|
|
||||||
def weight_max
|
def weight_max
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base
|
|||||||
belongs_to :tournament
|
belongs_to :tournament
|
||||||
has_many :wrestlers, dependent: :destroy
|
has_many :wrestlers, dependent: :destroy
|
||||||
|
|
||||||
attr_accessor :pools, :bracket_size
|
attr_accessor :pools, :bracket_size, :bracket_type
|
||||||
|
|
||||||
def generatePool
|
def generatePool
|
||||||
@wrestlers = Wrestler.where(weight_id: self.id)
|
@wrestlers = Wrestler.where(weight_id: self.id)
|
||||||
@@ -35,5 +35,15 @@ class Weight < ActiveRecord::Base
|
|||||||
return @wrestlers.size
|
return @wrestlers.size
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def bracket_type
|
||||||
|
if self.wrestlers.size > 7 && self.wrestlers.size <= 10
|
||||||
|
return "twoPoolsToSemi"
|
||||||
|
elsif self.wrestlers.size == 11
|
||||||
|
return "fourPoolsToQuarter"
|
||||||
|
elsif self.wrestlers.size > 11 && self.wrestlers.size <= 16
|
||||||
|
return "fourPoolsToSemi"
|
||||||
|
end
|
||||||
|
self.wrestlers.size
|
||||||
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,3 +1,8 @@
|
|||||||
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
|
<%= link_to "Back to #{@tournament.name}", "/tournaments/#{@tournament.id}" %>
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
</br>
|
||||||
|
The server is running processes in the background.
|
||||||
|
</br>
|
||||||
|
Please allow up to 10 minutes for all matches to be created.
|
||||||
<br>
|
<br>
|
||||||
Done!
|
|
||||||
Reference in New Issue
Block a user