Move group_match method to public methods

This is done in order to check if a match is a group match within
Matches Controller
This commit is contained in:
Daniel Schädler 2019-05-09 16:30:27 +02:00
parent 1304f86652
commit 4f3407077c
2 changed files with 11 additions and 4 deletions

View File

@ -24,6 +24,10 @@ class Match < ApplicationRecord
# This should maybe be cached or put into db # This should maybe be cached or put into db
end end
def group_match?
group.present?
end
private private
def evaluate_winner def evaluate_winner
@ -36,8 +40,4 @@ class Match < ApplicationRecord
def stage_xor_group def stage_xor_group
errors.add(:stage_xor_group, 'Stage and Group missing or both present') unless stage.present? ^ group.present? errors.add(:stage_xor_group, 'Stage and Group missing or both present') unless stage.present? ^ group.present?
end end
def group_match?
group.present?
end
end end

View File

@ -70,4 +70,11 @@ class PlayoffStageService
stage_count.to_int stage_count.to_int
end end
end end
def self.populate_match_below(match)
current_stage = match.stage
next_stage = match.stage.tournament.stages.
puts
end
end end