Skip to content

Commit

Permalink
Merge branch 'master' into contest-show-votes-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
notbakaneko authored Feb 1, 2024
2 parents 9d85352 + b0eedab commit cac9cb1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions app/Models/Solo/Score.php
Original file line number Diff line number Diff line change
Expand Up @@ -165,9 +165,14 @@ public function scopeIndexable(Builder $query): Builder
->whereHas('user', fn (Builder $q): Builder => $q->default());
}

/**
* This should only be used for user recent scores, not anything else
*/
public function scopeRecent(Builder $query, string $ruleset, bool $includeFails): Builder
{
return $query
// ensure correct index is used
->from(\DB::raw("{$this->getTable()} FORCE INDEX (user_ruleset_index)"))
->default()
->forRuleset($ruleset)
->includeFails($includeFails)
Expand Down

0 comments on commit cac9cb1

Please sign in to comment.