Set globalize fallbacks for requests

New version of globalize uses RequestStore gem to store I18n.locale and
Globalize.fallbacks in a per request basis to avoid collissions between
different requests. This gem update broke Globalize.fallback results
because it tries to fetch fallbacks from RequestStore, where there is no
locale fallbacks definition.
This commit is contained in:
Senén Rodero Rodríguez
2019-01-28 23:12:09 +01:00
committed by Julian Herrero
parent b36fdb5604
commit 97974a8bc7

View File

@@ -10,6 +10,7 @@ class ApplicationController < ActionController::Base
before_action :set_locale
before_action :track_email_campaign
before_action :set_return_url
before_action :set_fallbacks_to_all_available_locales
check_authorization unless: :devise_controller?
self.responder = ApplicationResponder
@@ -128,4 +129,8 @@ class ApplicationController < ActionController::Base
def current_budget
Budget.current
end
def set_fallbacks_to_all_available_locales
Globalize.set_fallbacks_to_all_available_locales
end
end