Class: FReCon::Robot
Overview
Public: The Robot model.
Instance Method Summary collapse
-
#competitions ⇒ Object
Public: Get this Robot’s Participations’ Competitions.
-
#matches ⇒ Object
Public: Get this Robot’s Participations’ Records’ Matches.
-
#records ⇒ Object
Public: Get this Robot’s Participations’ Records.
Methods inherited from Model
controller, descendants, inherited, #no_invalid_relations
Instance Method Details
#competitions ⇒ Object
Public: Get this Robot’s Participations’ Competitions
24 25 26 |
# File 'lib/frecon/models/robot.rb', line 24 def competitions Competition.in id: participations.map(&:competition_id) end |
#matches ⇒ Object
Public: Get this Robot’s Participations’ Records’ Matches
34 35 36 |
# File 'lib/frecon/models/robot.rb', line 34 def matches Match.in id: records.map(&:match_id).uniq end |
#records ⇒ Object
Public: Get this Robot’s Participations’ Records
29 30 31 |
# File 'lib/frecon/models/robot.rb', line 29 def records Record.in participation_id: participations.map(&:id) end |