execute check only when first load

This commit is contained in:
chiu 2020-05-26 20:44:36 +08:00
parent a6aff16099
commit 4cb636d8b2
1 changed files with 3 additions and 4 deletions

View File

@ -1,7 +1,7 @@
class ArchivesController < ApplicationController
def index
#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
end
@ -264,7 +264,6 @@ F cats = files_by_cateogry.keys.collect do |cat|
end
def widget
check_cat_sort_data()
if ArchiveSortOrder.count == 0
ArchiveSortOrder.new('sort_order' => false).save
end