diff options
author | tony <tony> | 2009-03-22 14:21:56 +0000 |
---|---|---|
committer | tony <tony> | 2009-03-22 14:21:56 +0000 |
commit | 49b77267e8d379cd11df95a9a0166f44c1a9a205 (patch) | |
tree | 6325fbe04b4c649b0c56d3c6421cc85531165b41 /app/controllers/body_controller.rb | |
parent | 691e55e876278aae1a2ebe625117f3833f17c716 (diff) |
Rollback 14514 and 14515 - model can't call methods in general_controller
Diffstat (limited to 'app/controllers/body_controller.rb')
-rw-r--r-- | app/controllers/body_controller.rb | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb index e3f4cd8cb..f89eb9d8c 100644 --- a/app/controllers/body_controller.rb +++ b/app/controllers/body_controller.rb @@ -4,7 +4,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: body_controller.rb,v 1.23 2009-03-22 10:31:20 tony Exp $ +# $Id: body_controller.rb,v 1.24 2009-03-22 14:21:56 tony Exp $ class BodyController < ApplicationController # XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL @@ -25,11 +25,15 @@ class BodyController < ApplicationController # Use search query for this so can collapse and paginate easily # XXX really should just use SQL query here rather than Xapian. - @xapian_requests = @public_body.xapian_requests - if (@page > 1) - @page_desc = " (page " + @page.to_s + ")" - else - @page_desc = "" + begin + @xapian_requests = perform_search([InfoRequestEvent], 'requested_from:' + @public_body.url_name, 'newest', 'request_collapse') + if (@page > 1) + @page_desc = " (page " + @page.to_s + ")" + else + @page_desc = "" + end + rescue + @xapian_requests = nil end @track_thing = TrackThing.create_track_for_public_body(@public_body) @@ -82,4 +86,3 @@ class BodyController < ApplicationController end end - |