class Admins::EnrollListsController < Admins::BaseController def index @competition = current_competition params[:sort_by] = params[:sort_by].presence || 'created_at' params[:sort_direction] = params[:sort_direction].presence || 'desc' enroll_lists = Admins::CompetitionEnrollListQuery.call(@competition, params) @params_page = params[:page] || 1 @enroll_lists = paginate enroll_lists.preload(competition_team: [:user, :teachers], user: { user_extension: :school }) @personal = @competition.personal? respond_to do |format| format.js format.html format.xls end end private def current_competition @_current_competition ||= Competition.find(params[:competition_id]) end end