fix: documents sort sql needs Arel.sql

This commit is contained in:
Philipp Rothmann 2023-10-02 22:48:24 +02:00
parent 55234b4e27
commit 6abf998b56

View file

@ -14,7 +14,7 @@ class DocumentsController < ApplicationController
else else
'data IS NULL DESC, name' 'data IS NULL DESC, name'
end end
sort = Arel.sql(sort) # this is okay as we don't use user params directly
@documents = Document.where(parent: @document).page(params[:page]).per(@per_page).order(sort) @documents = Document.where(parent: @document).page(params[:page]).per(@per_page).order(sort)
end end