diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-12-05 16:57:02 +0000 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-12-05 18:54:20 +0000 |
commit | 3ad5277ed2c9f98508a7208848e125d274c86a3b (patch) | |
tree | 87f8fdb3cc62b26c4766b8ed46c46bd23b3950e8 /app | |
parent | d35b7fec9ad723496c95791ae314964f4d3360dd (diff) |
Search for bodies using the underscore version of the locale.
Diffstat (limited to 'app')
-rw-r--r-- | app/models/public_body.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb index 8e474c797..c007afb6e 100644 --- a/app/models/public_body.rb +++ b/app/models/public_body.rb @@ -727,7 +727,8 @@ class PublicBody < ActiveRecord::Base # either from config, or based on a (slow!) query if not set body_short_names = AlaveteliConfiguration::frontpage_publicbody_examples.split(/\s*;\s*/) locale_condition = 'public_body_translations.locale = ?' - conditions = [locale_condition, locale] + underscore_locale = locale.gsub '-', '_' + conditions = [locale_condition, underscore_locale] bodies = [] I18n.with_locale(locale) do if body_short_names.empty? |