Simplify code involving Globalize.locale
We don't need to set this value. In commit f2ef27d3 I made a mistake
thinking `Globalize.locale` and `I18n.locale` should always be in sync,
but they're actually automatically in sync when `Globalize.locale` is
`nil`.
So the best way to avoid any issues is not to assign `Globalize.locale`,
and use `Globalize.with_locale` where necessary instead.
This commit is contained in:
@@ -18,8 +18,9 @@ class Admin::SiteCustomization::InformationTextsController < Admin::SiteCustomiz
|
||||
next
|
||||
else
|
||||
text = I18nContent.find_or_create_by!(key: content[:id])
|
||||
Globalize.locale = locale
|
||||
text.update!(value: value)
|
||||
Globalize.with_locale(locale) do
|
||||
text.update!(value: value)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user