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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user