aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/application_controller.rb8
-rw-r--r--app/controllers/general_controller.rb17
2 files changed, 9 insertions, 16 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index 4252d4212..1628d2f31 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -13,9 +13,17 @@ class ApplicationController < ActionController::Base
# Standard headers, footers and navigation for whole site
layout "default"
before_filter :set_gettext_locale
+
# scrub sensitive parameters from the logs
filter_parameter_logging :password
+ helper_method :site_name
+ def site_name
+ # XXX should come from database:
+ site_name = "WhatDoTheyKnow"
+ return site_name
+ end
+
# Help work out which request causes RAM spike.
# http://www.codeweblog.com/rails-to-monitor-the-process-of-memory-leaks-skills/
# This shows the memory use increase of the Ruby process due to the request.
diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb
index 21e715424..df46c4ae8 100644
--- a/app/controllers/general_controller.rb
+++ b/app/controllers/general_controller.rb
@@ -22,22 +22,7 @@ class GeneralController < ApplicationController
def frontpage
behavior_cache do
# This is too slow
- #@popular_bodies = PublicBody.find(:all, :select => "*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c", :order => "c desc", :limit => 32)
-
- # Just hardcode some popular authorities for now
- # ('tgq', 'atbra' is for debugging on Francis's development environment)
- @popular_bodies = PublicBody.find(:all, :conditions => ["url_name in (
- 'bbc',
- 'dwp',
- 'dh',
- 'snh',
- 'royal_mail_group',
- 'mod',
- 'kent_county_council',
- 'wirral_borough_council'
- /* , 'tgq', 'atbra' */
- )"]).sort_by { |pb| pb.url_name }.reverse # just an order that looks better
-
+ @popular_bodies = PublicBody.find(:all, :select => "*, (select count(*) from info_requests where info_requests.public_body_id = public_bodies.id) as c", :order => "c desc", :limit => 32)
# Get some successful requests #
begin
query = 'variety:response (status:successful OR status:partially_successful)'