Class: Jumbotron::Services::Public::LoadGamesByIds
- Inherits:
-
CommandTower::Services::ApplicationService
- Object
- CommandTower::Services::ApplicationService
- Jumbotron::Services::Public::LoadGamesByIds
- Defined in:
- app/services/jumbotron/services/public/load_games_by_ids.rb
Instance Method Summary collapse
Instance Method Details
#call ⇒ Object
9 10 11 12 13 14 |
# File 'app/services/jumbotron/services/public/load_games_by_ids.rb', line 9 def call ids = Array(game_ids) games = Game.includes(ReadGame::ASSOCIATIONS).where(id: ids).to_a by_id = games.index_by(&:id) context.games = ids.filter_map { |id| by_id[id] } end |