BREAKS BUILD: all pages etc are much faster, but categories functionality is broken (it was responsible for calling the renderer once per every page on All Pages)

This commit is contained in:
Alexey Verkhovsky 2005-09-11 09:34:41 +00:00
parent 541a5d3994
commit ac819d4d68
4 changed files with 8 additions and 3 deletions

View file

@ -291,7 +291,9 @@ class WikiController < ApplicationController
@category = @params['category']
@categories = []
@pages_in_category = @web.select do |page|
page_categories = PageRenderer.new(page.revisions.last).display_content.find_chunks(Category)
# FIXME: was PageRenderer.new(page.revisions.last).display_content.find_chunks(Category),
# heinously slow
page_categories = []
page_categories = page_categories.map { |cat| cat.list }.flatten
page_categories.each {|c| @categories << c unless @categories.include? c }
page_categories.include?(@category)