forked from Trustie/forgeplus
新增:排序正序与倒序
This commit is contained in:
parent
ad2f42bed6
commit
debefe2e7c
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue