From e3923bb5ff635a853d8923efaa0b6b9b19b218eb Mon Sep 17 00:00:00 2001 From: chiu Date: Thu, 19 Sep 2019 19:09:00 +0800 Subject: [PATCH] Update archive_files_controller.rb fix error --- app/controllers/admin/archive_files_controller.rb | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/app/controllers/admin/archive_files_controller.rb b/app/controllers/admin/archive_files_controller.rb index 6bb0af6..081dee7 100644 --- a/app/controllers/admin/archive_files_controller.rb +++ b/app/controllers/admin/archive_files_controller.rb @@ -16,8 +16,10 @@ class Admin::ArchiveFilesController < OrbitAdminController end keys.each_with_index do |key,index| archivecategory = ArchiveCategory.where(category_id: key) - archivecategory.first.sort_number = values[index] - archivecategory.first.save! + if !(values[index].empty?) + archivecategory.first['sort_number'] = values[index]_.to_i + archivecategory.first.save! + end end rescue => e puts e