From 675b816b09f4e65cc4880ecd4c8405943954d583 Mon Sep 17 00:00:00 2001 From: Godwin Date: Mon, 14 Sep 2015 21:38:06 -0700 Subject: [PATCH] Fix for incorrect redirection in preview --- config/application.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/config/application.rb b/config/application.rb index d1d9154..d2786d1 100644 --- a/config/application.rb +++ b/config/application.rb @@ -38,12 +38,13 @@ module BikeBike I18n.config.language_detection_method = I18n::Config::DETECT_LANGUAGE_FROM_SUBDOMAIN if Rails.env == 'preview' I18n.config.language_threshold = 1 + I18n.config.subdomain_format = 'preview-%' + # if we are in our preview environment, set the locale regex to detect the preview- prefix + I18n.config.host_locale_regex = /^preview\-([a-z]{2})\.bikebike\.org$/ else I18n.config.language_threshold = 90 end end - # if we are in our preview environment, set the locale regex to detect the preview- prefix - I18n.config.host_locale_regex = /^preview\-([a-z]{2})\.bikebike\.org$/ if Rails.env == 'preview' config.active_job.queue_adapter = :delayed_job end