Class: Jumbotron::Services::Public::LoadGamesByIds

Inherits:
CommandTower::Services::ApplicationService
  • Object
show all
Defined in:
app/services/jumbotron/services/public/load_games_by_ids.rb

Instance Method Summary collapse

Instance Method Details

#callObject



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