Class: FReCon::Match

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

Overview

Public: The Match model.

Instance Method Summary collapse

Methods inherited from Model

controller, descendants, inherited, #no_invalid_relations

Instance Method Details

#participationsObject

Public: Get this Match’s Participations



28
29
30
# File 'lib/frecon/models/match.rb', line 28

def participations
	Participation.in id: records.map(&:participation_id)
end

#robotsObject

Public: Get this Match’s Participations’ Robots



33
34
35
# File 'lib/frecon/models/match.rb', line 33

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

#teamsObject

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



38
39
40
# File 'lib/frecon/models/match.rb', line 38

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