class StatsController < ApplicationController before_action :authenticate_user! def index @stats = current_user.stats.group_by(&:year).sort_by { _1 }.reverse end end