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
25 26 27 |
# File 'lib/frecon/models/robot.rb', line 25 def competitions Competition.in id: participations.map(&:competition_id) end |
#matches ⇒ Object
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 |
#records ⇒ Object
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 |