DEV: Auto-allow multisite hosts in dev (#17246)
This commit is contained in:
parent
2b80133819
commit
a7284d3b96
|
@ -48,6 +48,14 @@ elsif Rails.configuration.multisite
|
|||
if defined?(RailsFailover::ActiveRecord) && Rails.configuration.active_record_rails_failover
|
||||
Rails.configuration.middleware.insert_after(RailsMultisite::Middleware, RailsFailover::ActiveRecord::Middleware)
|
||||
end
|
||||
|
||||
if Rails.env.development?
|
||||
# Automatically allow development multisite hosts
|
||||
RailsMultisite::ConnectionManagement.instance.db_spec_cache.each do |db, specification|
|
||||
next if db == "default"
|
||||
Rails.configuration.hosts.concat(specification.spec.configuration_hash[:host_names])
|
||||
end
|
||||
end
|
||||
elsif defined?(RailsFailover::ActiveRecord) && Rails.configuration.active_record_rails_failover
|
||||
Rails.configuration.middleware.insert_before(MessageBus::Rack::Middleware, RailsFailover::ActiveRecord::Middleware)
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue