1
0
mirror of https://github.com/jcwimer/wrestlingApp synced 2026-04-04 13:43:48 +00:00

Created one page for all pools

This commit is contained in:
2015-03-27 16:33:09 +00:00
parent 86faf8b2a4
commit a821c28cf7
4 changed files with 60 additions and 11 deletions

View File

@@ -2,7 +2,7 @@ class Weight < ActiveRecord::Base
belongs_to :tournament
has_many :wrestlers, dependent: :destroy
attr_accessor :pools, :bracket_size, :bracket_type
attr_accessor :pools, :bracket_size, :bracket_type, :poolRounds
def pools
@wrestlers = self.wrestlers
@@ -111,4 +111,10 @@ class Weight < ActiveRecord::Base
return @matches
end
def poolRounds(matches)
@matchups = matches.select{|m| m.weight_id == self.id}
@poolMatches = @matchups.select{|m| m.bracket_position == nil}
return @poolMatches.sort_by{|m| m.round}.last.round
end
end