mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user