fix error

This commit is contained in:
chiu 2020-05-26 20:48:24 +08:00
parent 4350d4e8ed
commit aebc498144
1 changed files with 6 additions and 9 deletions

View File

@ -1,15 +1,12 @@
class ArchivesController < ApplicationController
def check_cat_sort_data
categories_temp = ModuleApp.where(:key => "archive").first.categories
categories_temp.each do |category|
archive_cat = ArchiveCategory.where(:category_id => category.id)
if archive_cat.count == 0
ArchiveCategory.create(category_id: category.id.to_s)
end
#avoid the categories to be not in the ArchiveCategory
categories_temp = ModuleApp.where(:key => "archive").first.categories
categories_temp.each do |category|
archive_cat = ArchiveCategory.where(:category_id => category.id)
if archive_cat.count == 0
ArchiveCategory.create(category_id: category.id.to_s)
end
end
#avoid the categories to be not in the ArchiveCategory
check_cat_sort_data()
def index
if ArchiveSortOrder.count == 0
ArchiveSortOrder.new('sort_order' => false).save