fix error

This commit is contained in:
chiu 2021-09-17 14:02:47 +08:00
parent 7568aaafaf
commit 5758a91865
1 changed files with 5 additions and 5 deletions

View File

@ -18,7 +18,7 @@ class ArchiveFile
before_save do before_save do
cat = self.category rescue nil cat = self.category rescue nil
if cat && ArchiveCategory.where(:category_id => cat.id).count==0 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
end end
@ -109,10 +109,10 @@ class ArchiveFile
end end
def save_archive_file_multiples def save_archive_file_multiples
self.archive_file_multiples.each do |t| self.archive_file_multiples.each do |t|
if t.should_destroy if t.should_destroy
t.destroy t.destroy
end end
end end
end end