diff options
Diffstat (limited to 'app/controllers')
-rw-r--r-- | app/controllers/comment_controller.rb | 2 | ||||
-rw-r--r-- | app/controllers/general_controller.rb | 9 |
2 files changed, 6 insertions, 5 deletions
diff --git a/app/controllers/comment_controller.rb b/app/controllers/comment_controller.rb index 0bba0cfb8..86d5b0a06 100644 --- a/app/controllers/comment_controller.rb +++ b/app/controllers/comment_controller.rb @@ -54,7 +54,7 @@ class CommentController < ApplicationController if authenticated?( :web => _("To post your annotation"), :email => _("Then your annotation to {{info_request_title}} will be posted.",:info_request_title=>@info_request.title), - :email_subject => _("Confirm your annotation to {{info_request_title}}",:info_request.title=>@info_request.title) + :email_subject => _("Confirm your annotation to {{info_request_title}}",:info_request_title=>@info_request.title) ) # Also subscribe to track for this request, so they get updates diff --git a/app/controllers/general_controller.rb b/app/controllers/general_controller.rb index 21f3edbb1..17f39740f 100644 --- a/app/controllers/general_controller.rb +++ b/app/controllers/general_controller.rb @@ -26,10 +26,10 @@ class GeneralController < ApplicationController # get some example searches and public bodies to display # either from config, or based on a (slow!) query if not set body_short_names = MySociety::Config.get('FRONTPAGE_PUBLICBODY_EXAMPLES', '').split(/\s*;\s*/).map{|s| "'%s'" % s.gsub(/'/, "''") }.join(", ") - @locale = self.locale_from_params() - locale_condition = 'public_body_translations.locale = ?' + @locale = self.locale_from_params() + locale_condition = 'public_body_translations.locale = ?' conditions = [locale_condition, @locale] - PublicBody.with_locale(@locale) do + PublicBody.with_locale(@locale) do if body_short_names.empty? # This is too slow @popular_bodies = PublicBody.find(:all, @@ -40,8 +40,9 @@ class GeneralController < ApplicationController :joins => :translations ) else + conditions[0] += " and public_bodies.url_name in (" + body_short_names + ")" @popular_bodies = PublicBody.find(:all, - :conditions => conditions + ["url_name in (" + body_short_names + ")"], + :conditions => conditions, :joins => :translations) end end |