mirror of
https://github.com/ryankazokas/turbovault-app.git
synced 2026-04-16 23:22:53 +00:00
Adds types
This commit is contained in:
@@ -1,6 +1,10 @@
|
||||
# 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)
|
||||
@@ -10,17 +14,7 @@ class DashboardController < ApplicationController
|
||||
@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)
|
||||
.group("platforms.name")
|
||||
.count
|
||||
.sort_by { |_, count| -count }
|
||||
.first(5)
|
||||
|
||||
@games_by_genre = current_user.games.joins(:genres)
|
||||
.group("genres.name")
|
||||
.count
|
||||
.sort_by { |_, count| -count }
|
||||
.first(5)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user