mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-16 21:02:52 +00:00
21 lines
754 B
Ruby
21 lines
754 B
Ruby
# typed: true
|
|
|
|
class DashboardController < ApplicationController
|
|
extend T::Sig
|
|
before_action :require_authentication
|
|
|
|
sig { void }
|
|
def index
|
|
@recently_added_games = current_user.games.recent.limit(5)
|
|
@currently_playing_games = current_user.games.currently_playing.limit(5)
|
|
@total_games = current_user.games.count
|
|
@physical_games = current_user.games.physical_games.count
|
|
@digital_games = current_user.games.digital_games.count
|
|
@completed_games = current_user.games.completed.count
|
|
@backlog_games = current_user.games.backlog.count
|
|
@total_spent = current_user.games.sum(:price_paid) || 0
|
|
@games_by_platform = current_user.games.joins(:platform)
|
|
@games_by_genre = current_user.games.joins(:genres)
|
|
end
|
|
end
|