From a603b89eaee5ed22e7857d54fecd82c938763ac4 Mon Sep 17 00:00:00 2001 From: Louise Crow Date: Wed, 26 Sep 2012 11:22:50 +0100 Subject: Use new info_requests_count counter cache column on public body when generating front page. --- app/controllers/general_controller.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'app/controllers/general_controller.rb') diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 839064fcd..5a7b006a0 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -32,8 +32,7 @@ class GeneralController < ApplicationController if body_short_names.empty? # This is too slow @popular_bodies = PublicBody.find(:all, - :select => "public_bodies.*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c", - :order => "c desc", + :order => "info_requests_count desc", :limit => 32, :conditions => conditions, :joins => :translations -- cgit v1.2.3