From 2fcfe60017b1339afcedab9bd0b979f78c0298f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B1=E5=8D=9A=E4=BA=9E?= Date: Mon, 18 Jan 2021 14:53:27 +0800 Subject: [PATCH] fix sort error --- app/controllers/archives_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 2009347..e3ae340 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -73,7 +73,7 @@ class ArchivesController < ApplicationController page.save end end - files_by_category = ArchiveFile.where(is_hidden: false).filter_by_categories.filter_by_tags.group_by(&:category) + files_by_category = ArchiveFile.where(is_hidden: false).filter_by_categories.filter_by_tags.order_by(:created_at => "desc").group_by(&:category) each_data_count = [] categories = files_by_category.keys categories_sort = get_sorted_cat_with_filter(categories,'orm')