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:
parent
1304f86652
commit
4f3407077c
|
|
@ -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
|
||||||
|
|
|
||||||
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue