fix data_count problem

This commit is contained in:
Harry Bomrah 2015-09-18 16:45:42 +08:00
parent 9815866b16
commit fd29da19e5
1 changed files with 9 additions and 1 deletions

View File

@ -1,5 +1,13 @@
class ArchivesController < ApplicationController
def index
if OrbitHelper.page_data_count > 0
OrbitHelper.set_page_data_count 0
page = Page.where(:page_id => OrbitHelper.params["page_id"]).first rescue nil
if !page.nil?
page.data_count = 0
page.save
end
end
files_by_cateogry = ArchiveFile.filter_by_categories.filter_by_tags.group_by(&:category)
categories = files_by_cateogry.keys
cats = categories.collect do |category|