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



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

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

#robotsObject

Public: Get this Match’s Participations’ Robots



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

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

#teamsObject

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



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

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