新增:排序正序与倒序

This commit is contained in:
yystopf 2025-07-24 10:15:49 +08:00
parent ad2f42bed6
commit debefe2e7c
1 changed files with 1 additions and 1 deletions

View File

@ -118,7 +118,7 @@ class Issue < ApplicationRecord
LEFT JOIN users u ON assigner.assigner_id = u.id")
}
scope :ordered_by_assigner(sort_direction), -> {
scope :ordered_by_assigner, -> (sort_direction) {
order("CASE WHEN u.id IS NULL THEN 1 ELSE 0 END #{sort_direction}")
.order("COALESCE(u.nickname, u.login) DESC")
}