plays-hub/app/controllers/statistics_controller.rb

16 lines
501 B
Ruby

class StatisticsController < ApplicationController
before_action :authenticate_user!
def index
stats = Statistics.new(current_user)
@total_plays = stats.total_plays
@year_plays = stats.total_plays_year
@activity_by_day = stats.activity_by_day
@top_artists_all_time = stats.top_artists_all_time
@top_artists_year = stats.top_artists_year
@top_artists_upcoming = stats.top_artists_upcoming
@since_date = stats.since_date
@streak = stats.longest_streak
end
end