fix error
This commit is contained in:
parent
4cb636d8b2
commit
4350d4e8ed
|
@ -1,4 +1,13 @@
|
|||
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
|
||||
end
|
||||
end
|
||||
#avoid the categories to be not in the ArchiveCategory
|
||||
check_cat_sort_data()
|
||||
def index
|
||||
|
@ -355,13 +364,4 @@ F cats = files_by_cateogry.keys.collect do |cat|
|
|||
def self.get_total_pages
|
||||
@@total_pages
|
||||
end
|
||||
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
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Reference in New Issue