aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_general_controller.rb
diff options
context:
space:
mode:
authorLouise Crow <louise.crow@gmail.com>2013-12-18 19:08:08 +0000
committerLouise Crow <louise.crow@gmail.com>2014-01-13 12:36:41 +0000
commitbfd1a71eeb4962996db5b226a976558b9f7a50bd (patch)
treedb2c48f19a5dced92b978aa3d7fca70c32896932 /app/controllers/admin_general_controller.rb
parent6bd51ecc137c3366ebfb83951b99ac3c50512c1f (diff)
Clean up admin index
Refactor a bit so it's easier to read.
Diffstat (limited to 'app/controllers/admin_general_controller.rb')
-rw-r--r--app/controllers/admin_general_controller.rb11
1 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/admin_general_controller.rb b/app/controllers/admin_general_controller.rb
index 196616ed6..1bdd0c772 100644
--- a/app/controllers/admin_general_controller.rb
+++ b/app/controllers/admin_general_controller.rb
@@ -27,12 +27,13 @@ class AdminGeneralController < AdminController
@comment_count = Comment.count
# Tasks to do
- @requires_admin_requests = InfoRequest.find(:all, :select => '*, ' + InfoRequest.last_event_time_clause + ' as last_event_time', :conditions => ["described_state = 'requires_admin'"], :order => "last_event_time")
- @error_message_requests = InfoRequest.find(:all, :select => '*, ' + InfoRequest.last_event_time_clause + ' as last_event_time', :conditions => ["described_state = 'error_message'"], :order => "last_event_time")
- @attention_requests = InfoRequest.find(:all, :select => '*, ' + InfoRequest.last_event_time_clause + ' as last_event_time', :conditions => ["described_state = 'attention_requested'"], :order => "last_event_time")
- @blank_contacts = PublicBody.find(:all, :conditions => ["request_email = ''"], :order => "updated_at")
+ @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.find(:all, :conditions => ["request_email = ''"],
+ :order => "updated_at")
@old_unclassified = InfoRequest.find_old_unclassified(:limit => 20,
- :conditions => ["prominence = 'normal'"])
+ :conditions => ["prominence = 'normal'"])
@holding_pen_messages = InfoRequest.holding_pen_request.incoming_messages
end