aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/public_body.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/public_body.rb')
-rw-r--r--app/models/public_body.rb7
1 files changed, 4 insertions, 3 deletions
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index eb0905f9e..933825d2a 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -260,13 +260,13 @@ class PublicBody < ActiveRecord::Base
# When name or short name is changed, also change the url name
def short_name=(short_name)
- globalize.write(I18n.locale, :short_name, short_name)
+ globalize.write(Globalize.locale, :short_name, short_name)
self[:short_name] = short_name
self.update_url_name
end
def name=(name)
- globalize.write(I18n.locale, :name, name)
+ globalize.write(Globalize.locale, :name, name)
self[:name] = name
self.update_url_name
end
@@ -742,7 +742,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?