From 5758a91865e3bc452524b543eb8f75b0fcf4e286 Mon Sep 17 00:00:00 2001 From: chiu Date: Fri, 17 Sep 2021 14:02:47 +0800 Subject: [PATCH] fix error --- app/models/archive_file.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/models/archive_file.rb b/app/models/archive_file.rb index ee2542b..eb19fc5 100644 --- a/app/models/archive_file.rb +++ b/app/models/archive_file.rb @@ -18,7 +18,7 @@ class ArchiveFile before_save do cat = self.category rescue nil if cat && ArchiveCategory.where(:category_id => cat.id).count==0 - ArchiveCategory.create(category_id: cat.id.to_s) + ArchiveCategory.create(category_id: cat.id.to_s,sort_number: cat.sort_number) end end @@ -109,10 +109,10 @@ class ArchiveFile end def save_archive_file_multiples - self.archive_file_multiples.each do |t| - if t.should_destroy - t.destroy - end + self.archive_file_multiples.each do |t| + if t.should_destroy + t.destroy + end end end