DEV: Prevent automatic restart of rails console (and crashing zsh) (#13066)

Only a server should be restarted when non-autoloaded ruby files are edited.
This commit is contained in:
Gerhard Schlager 2021-05-14 18:19:22 +02:00 committed by GitHub
parent c0679022e7
commit d6b53b688d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,7 +3,7 @@
# Development helper which prints a warning when you edit a non-autoloaded ruby file.
# These include initializers, middleware, plugin.rb files, and more.
# Launch the server with AUTO_RESTART=0 to disable automatic restarts.
if Rails.env.development? && !Rails.configuration.cache_classes
if Rails.env.development? && !Rails.configuration.cache_classes && Discourse.running_in_rack?
paths = [
*Dir["#{Rails.root}/app/*"].reject { |path| path.end_with? "/assets" },
"#{Rails.root}/config",