aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--app/controllers/body_controller.rb5
1 files changed, 3 insertions, 2 deletions
diff --git a/app/controllers/body_controller.rb b/app/controllers/body_controller.rb
index e8e0780cd..5e0dfec87 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.20 2009-03-18 02:37:42 francis Exp $
+# $Id: body_controller.rb,v 1.21 2009-03-20 13:32:53 tony Exp $
class BodyController < ApplicationController
# XXX tidy this up with better error messages, and a more standard infrastructure for the redirect to canonical URL
@@ -14,7 +14,8 @@ class BodyController < ApplicationController
return
end
- @public_bodies = PublicBody.find(:all, :conditions => [ "url_name = ?", params[:url_name] ])
+ @public_bodies = PublicBody.find_all_by_url_name(params[:url_name])
+ # Shouldn't we just make url_name unique?
if @public_bodies.size > 1
raise "Two bodies with the same URL name: " . params[:url_name]
end