From 97974a8bc7b8e29f0dc5e319e6f8484aea8a4bba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sen=C3=A9n=20Rodero=20Rodr=C3=ADguez?= Date: Mon, 28 Jan 2019 23:12:09 +0100 Subject: [PATCH] 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. --- app/controllers/application_controller.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index 5df842899..38ce20f34 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -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