sub user_list {
my $rs = $_[0]->users->search(undef, {columns => USER_PUBLIC_COLUMNS, prefetch => [qw/problem_statuses contest_statuses/]} );
[ sort { $b->{solved} <=> $a->{solved} or $b->{attempted} <=> $a->{attempted} } map { ## no critic (ProhibitReverseSort)
- my $solved = $_->problem_statuses->count(solved => 1);
- my $attempted = $_->problem_statuses->count(solved => 0);
+ my $solved = $_->problem_statuses->count({solved => 1});
+ my $attempted = $_->problem_statuses->count({solved => 0});
my $contests = $_->contest_statuses->count;
+{ $_->get_columns, solved => $solved, attempted => $attempted, contests => $contests }
} $rs->all ]