From 9deefa396fe11c128189c3d630c971280c0ef688 Mon Sep 17 00:00:00 2001 From: Thomas von Deyen Date: Mon, 26 Mar 2018 09:35:00 +0200 Subject: [PATCH] Do not reload essence classes in dev mode Reloading the essence classes on each request in dev mode causes trouble like mismatching parent classes. This also works without reloading. --- lib/alchemy/engine.rb | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/lib/alchemy/engine.rb b/lib/alchemy/engine.rb index 7a089a2728..fca02794f8 100644 --- a/lib/alchemy/engine.rb +++ b/lib/alchemy/engine.rb @@ -21,17 +21,6 @@ class Engine < Rails::Engine Gutentag.normaliser = ->(value) { value.to_s } end - # We need to reload each essence class in development mode on every request, - # so it can register itself as essence relation on Page and Element models - # - # @see lib/alchemy/essence.rb:71 - config.to_prepare do - unless Rails.configuration.cache_classes - essences = File.join(File.dirname(__FILE__), '../../app/models/alchemy/essence_*.rb') - Dir.glob(essences).each { |essence| load(essence) } - end - end - config.after_initialize do require_relative './userstamp' end