From 2068cd41eff4a9ea9c96b3d4d619666aefc4f2c1 Mon Sep 17 00:00:00 2001 From: chiu Date: Mon, 16 Sep 2019 19:08:11 +0800 Subject: [PATCH] Update archive_files_controller.rb --- app/controllers/admin/archive_files_controller.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 623c8c8..121aeaf 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -3,14 +3,12 @@ class Admin::ArchiveFilesController < OrbitAdminController if ArchiveSortOrder.count == 0 ArchiveSortOrder.new('sort_order' => false).save end - if !params['order_asc'].nil? + if !(params['order_asc'].nil?) if params['order_asc'] == 'true' ArchiveSortOrder.first.update_attributes('sort_order' => true) elsif params['order_asc'] == 'false' ArchiveSortOrder.first.update_attributes('sort_order' => false) end - else - ArchiveSortOrder.first.update_attributes('sort_order' => false) end @choose = ArchiveSortOrder.first['sort_order'] @table_fields = [:status, :category, :title, :updated_at,:last_modified,"archive.downloaded_times"]