From e96b39663d41f6f8fa8c89277f26032b1b99a8c0 Mon Sep 17 00:00:00 2001 From: Gareth Rees Date: Thu, 30 Apr 2015 16:24:49 +0100 Subject: Improve speed of collecting bodies with no email user system total real old 0.050000 0.020000 0.070000 ( 0.088856) new 0.020000 0.000000 0.020000 ( 0.018556) --- app/controllers/admin_general_controller.rb | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'app/controllers/admin_general_controller.rb') diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb index 13edec37d..3eaabda81 100644 --- a/app/controllers/admin_general_controller.rb +++ b/app/controllers/admin_general_controller.rb @@ -23,7 +23,11 @@ class AdminGeneralController < AdminController @requires_admin_requests = InfoRequest.find_in_state('requires_admin') @error_message_requests = InfoRequest.find_in_state('error_message') @attention_requests = InfoRequest.find_in_state('attention_requested') - @blank_contacts = PublicBody.where(:request_email => "").order(:updated_at).select { |pb| !pb.defunct? } + @blank_contacts = PublicBody. + includes(:tags). + where(:request_email => ""). + order(:updated_at). + select { |pb| !pb.defunct? } @old_unclassified = InfoRequest.find_old_unclassified(:limit => 20, :conditions => ["prominence = 'normal'"]) @holding_pen_messages = InfoRequest.holding_pen_request.incoming_messages -- cgit v1.2.3