From a2cf89f090608347a59a1478febe1ddfe9b296ec Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 19 Sep 2019 19:20:50 +0800 Subject: [PATCH] Update archive_files_controller.rb finish --- app/controllers/admin/archive_files_controller.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 8dfaaba..647a333 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -73,8 +73,8 @@ class Admin::ArchiveFilesController < OrbitAdminController ArchiveCategory.create(category_id: category.id.to_s) end end - cats_with_nil = ArchiveCategory.all.in(sort_number: nil).order_by(sort_number: 'desc') - cats_no_nil = ArchiveCategory.all.not_in(sort_number: nil) + cats_with_nil = ArchiveCategory.all.in(sort_number: nil) + cats_no_nil = ArchiveCategory.all.not_in(sort_number: nil).order_by(sort_number: 'desc') @cats = cats_no_nil.concat(cats_with_nil).collect do |cat| [categories.where(:_id => cat.category_id).first,cat.sort_number.to_s] end