mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Revert "Revert "DEV: upgrade to Rails 6.0.3""
This reverts commit 2ff8b4f5d9.
Attempt #2 at a Rails update this time we also update the
rails_multisite gem to allow for cleaner reordering
This commit is contained in:
@@ -6,12 +6,8 @@
|
||||
#
|
||||
# We aren't manipulating the middleware stack directly because of
|
||||
# https://github.com/rails/rails/pull/27936
|
||||
session_operations = Rails::Configuration::MiddlewareStackProxy.new([
|
||||
[:delete, MessageBus::Rack::Middleware],
|
||||
[:unshift, MessageBus::Rack::Middleware],
|
||||
])
|
||||
|
||||
Rails.configuration.middleware = Rails.configuration.middleware + session_operations
|
||||
Rails.configuration.middleware.unshift(MessageBus::Rack::Middleware)
|
||||
|
||||
# no reason to track this in development, that is 300+ redis calls saved per
|
||||
# page view (we serve all assets out of thin in development)
|
||||
@@ -25,12 +21,7 @@ if Rails.env != 'development' || ENV['TRACK_REQUESTS']
|
||||
end
|
||||
|
||||
if Rails.configuration.multisite
|
||||
# Multisite needs to be first, because the request tracker and message bus
|
||||
# rely on it
|
||||
session_operations = Rails::Configuration::MiddlewareStackProxy.new([
|
||||
[:delete, RailsMultisite::Middleware],
|
||||
[:unshift, [RailsMultisite::Middleware, RailsMultisite::DiscoursePatches.config]],
|
||||
])
|
||||
|
||||
Rails.configuration.middleware = Rails.configuration.middleware + session_operations
|
||||
# Multisite needs to be first, because the request tracker and message bus rely on it
|
||||
Rails.configuration.middleware.unshift RailsMultisite::Middleware, RailsMultisite::DiscoursePatches.config
|
||||
Rails.configuration.middleware.delete ActionDispatch::Executor
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user