Class: FReCon::Robot

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

Overview

Public: The Robot model.

Instance Method Summary collapse

Methods inherited from Model

controller, descendants, inherited, #no_invalid_relations

Instance Method Details

#competitionsObject

Public: Get this Robot’s Participations’ Competitions



25
26
27
# File 'lib/frecon/models/robot.rb', line 25

def competitions
	Competition.in id: participations.map(&:competition_id)
end

#matchesObject

Public: Get this Robot’s Participations’ Records’ Matches



35
36
37
# File 'lib/frecon/models/robot.rb', line 35

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

#recordsObject

Public: Get this Robot’s Participations’ Records



30
31
32
# File 'lib/frecon/models/robot.rb', line 30

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