mirror of
https://github.com/opf/openproject.git
synced 2026-06-14 03:30:14 +00:00
Properly format native SQL in Principals.ordered_by_name scope
This commit is contained in:
@@ -41,7 +41,7 @@ module Principals::Scopes
|
||||
def ordered_by_name(desc: false)
|
||||
direction = desc ? "DESC" : "ASC"
|
||||
|
||||
order_case = Arel.sql <<~SQL
|
||||
order_case = Arel.sql(<<~SQL.squish)
|
||||
CASE
|
||||
WHEN users.type = 'User' THEN LOWER(#{user_concat_sql})
|
||||
WHEN users.type != 'User' THEN LOWER(users.lastname)
|
||||
|
||||
Reference in New Issue
Block a user