diff options
author | Gareth Rees <gareth@mysociety.org> | 2015-04-30 16:24:49 +0100 |
---|---|---|
committer | Gareth Rees <gareth@mysociety.org> | 2015-05-07 15:53:13 +0100 |
commit | e96b39663d41f6f8fa8c89277f26032b1b99a8c0 (patch) | |
tree | 192ce1a7de7adeb4f0cba01f8b82616f4c38f06e | |
parent | 9565fd3038751713e2a1a1da3fe246dcc6e35742 (diff) |
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)
-rw-r--r-- | app/controllers/admin_general_controller.rb | 6 |
1 files changed, 5 insertions, 1 deletions
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 |