Refix category display. Refs #2162

This commit is contained in:
Pavel Chipiga 2011-11-01 23:56:50 +02:00
parent 0255334bc5
commit 38f96adbba
1 changed files with 1 additions and 1 deletions

View File

@ -19,7 +19,7 @@ class CategoriesController < ApplicationController
can_perform? @platform can_perform? @platform
@categories = Category.select('categories.id, categories.name, categories.ancestry, count(projects.id) projects_count'). @categories = Category.select('categories.id, categories.name, categories.ancestry, count(projects.id) projects_count').
joins(:projects => :repositories).where('repositories.platform_id = ?', @platform.id). joins(:projects => :repositories).where('repositories.platform_id = ?', @platform.id).
having('projects_count > 0').group('categories.id, categories.name, categories.ancestry').default_order having('projects_count > 0').group('categories.id, categories.name, categories.ancestry, projects_count').default_order
render 'index2' render 'index2'
else else
@categories = Category.default_order.paginate(:page => params[:page]) @categories = Category.default_order.paginate(:page => params[:page])