aboutsummaryrefslogtreecommitdiffstats
path: root/app/controllers/admin_request_controller.rb
diff options
context:
space:
mode:
authorMatthew Landauer <matthew@openaustralia.org>2013-01-30 08:17:00 +1100
committerMatthew Landauer <matthew@openaustralia.org>2013-01-30 08:17:00 +1100
commit91f361f2e5676000a51a45f25294484a1b50eb05 (patch)
tree73bcd84a98c49749455798b2c2f153c8caa66323 /app/controllers/admin_request_controller.rb
parent4e4ec14ebcc9ddd161bc61a5bbce9ce0cd4e3610 (diff)
If now query is supplied get all the requests
Diffstat (limited to 'app/controllers/admin_request_controller.rb')
-rw-r--r--app/controllers/admin_request_controller.rb14
1 files changed, 10 insertions, 4 deletions
diff --git a/app/controllers/admin_request_controller.rb b/app/controllers/admin_request_controller.rb
index c7c8d4972..15b8b0ddf 100644
--- a/app/controllers/admin_request_controller.rb
+++ b/app/controllers/admin_request_controller.rb
@@ -14,10 +14,16 @@ class AdminRequestController < AdminController
def list
@query = params[:query]
- @info_requests = InfoRequest.paginate :order => "created_at desc",
- :page => params[:page],
- :per_page => 100,
- :conditions => @query.nil? ? nil : ["lower(title) like lower('%'||?||'%')", @query]
+ if @query
+ @info_requests = InfoRequest.paginate :order => "created_at desc",
+ :page => params[:page],
+ :per_page => 100,
+ :conditions => ["lower(title) like lower('%'||?||'%')", @query]
+ else
+ @info_requests = InfoRequest.all.paginate :order => "created_at desc",
+ :page => params[:page],
+ :per_page => 100
+ end
end
def list_old_unclassified