Class: FReCon::Competition

Inherits:
Model show all
Defined in:
lib/frecon/models/competition.rb

Overview

Public: The Competition model.

Instance Method Summary collapse

Methods inherited from Model

controller, descendants, inherited, #no_invalid_relations

Instance Method Details

#recordsObject

Public: Get this Competition’s Matches’ Records



26
27
28
# File 'lib/frecon/models/competition.rb', line 26

def records
	Record.in match_id: matches.map(&:id)
end

#robotsObject

Public: Get this Competition’s Participations’ Robots



31
32
33
# File 'lib/frecon/models/competition.rb', line 31

def robots
	Robot.in id: participations.map(&:robot_id)
end

#teamsObject

Public: Get this Competition’s Participations’ Robots’ Teams



36
37
38
# File 'lib/frecon/models/competition.rb', line 36

def teams
	Team.in id: robots.map(&:team_id)
end