aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/general_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2012-09-26 11:22:50 +0100
committerLouise Crow <louise.crow@gmail.com>2012-09-26 11:22:50 +0100
commita603b89eaee5ed22e7857d54fecd82c938763ac4 (patch)
tree136961bd8cd1d85cf0644b7fb0280d3854b407c2 /app/controllers/general_controller.rb
parenta367b849b4471c49adc8fde39c8ab03542e7df61 (diff)
Use new info_requests_count counter cache column on public body when generating front page.
Diffstat (limited to 'app/controllers/general_controller.rb')
-rw-r--r--app/controllers/general_controller.rb3
1 files changed, 1 insertions, 2 deletions
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