Added get_latest and test for it on leaderboard

This commit is contained in:
Tom Bloor 2017-06-05 22:15:27 +01:00
parent 2e3bc489ea
commit 7e11fc50bd
2 changed files with 49 additions and 13 deletions

View file

@ -196,7 +196,11 @@ sub _create_count_all_time {
sub get_latest {
my $self = shift;
return $self;
my $latest = $self->search_related('sets', {}, {
order_by => { -desc => 'date' },
})->first;
return $latest;
}
1;