fix order queries

This commit is contained in:
Pete Matsyburka
2025-04-22 16:32:09 +03:00
parent e1cd62ff40
commit 7fee82ded2
7 changed files with 97 additions and 68 deletions
@@ -5,8 +5,9 @@ class TemplateFoldersController < ApplicationController
def show
@templates = @template_folder.templates.active.accessible_by(current_ability)
.preload(:author, :template_accesses).order(id: :desc)
.preload(:author, :template_accesses)
@templates = Templates.search(@templates, params[:q])
@templates = Templates::Order.call(@templates, cookies.permanent[:dashboard_templates_order])
@pagy, @templates = pagy(@templates, limit: 12)
end