FIX: Fix rake db:create after zeitwerk changes

Post-zeitwerk, rails has deprecated autoloading modules during
initialization and forces all autoloaded modules to be reloaded after
initialization.

Requiring the file explicitly prevents autoloading and therefore
prevents the state on SiteSetting being trashed which was causing the
problem here.
This commit is contained in:
Daniel Waterworth
2019-10-08 12:19:05 +01:00
parent fdb1d3404c
commit 4c9ed7bd85

View File

@@ -6,6 +6,10 @@
Discourse.git_version
if GlobalSetting.skip_redis?
# Requiring this file explicitly prevents it from being autoloaded and so the
# provider attribute is not cleared
require File.expand_path('../../../app/models/site_setting', __FILE__)
require 'site_settings/local_process_provider'
Rails.cache = Discourse.cache
SiteSetting.provider = SiteSettings::LocalProcessProvider.new