From fd29da19e5325947423e6e65edf83efd0a705c9c Mon Sep 17 00:00:00 2001 From: Harry Bomrah Date: Fri, 18 Sep 2015 16:45:42 +0800 Subject: [PATCH] fix data_count problem --- app/controllers/archives_controller.rb | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/archives_controller.rb b/app/controllers/archives_controller.rb index 4ca0c51..a4bf6f1 100644 --- a/app/controllers/archives_controller.rb +++ b/app/controllers/archives_controller.rb @@ -1,5 +1,13 @@ class ArchivesController < ApplicationController - def index + 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|