From bd1f928c28ff177e47f4701e67f92e0fdac4ffab Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Mon, 5 Feb 2018 15:19:46 +0800 Subject: [PATCH] attempt to fix sorting issue --- 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 2a09741..9d464b2 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -8,7 +8,7 @@ class ArchivesController < ApplicationController page.save end end - files_by_cateogry = ArchiveFile.where(is_hidden: false).filter_by_categories.filter_by_tags.group_by(&:category) + files_by_cateogry = ArchiveFile.where(is_hidden: false).filter_by_categories.filter_by_tags.order_by(:created_at => "desc").group_by(&:category) categories = files_by_cateogry.keys cats = categories.collect do |category| url_to_edit = OrbitHelper.user_has_cateogry?(category) ? "/admin/archive_files?filters[category][]=#{category.id.to_s}" : ""