Skip to content

Commit

Permalink
Do not reload essence classes in dev mode
Browse files Browse the repository at this point in the history
Reloading the essence classes on each request in dev mode causes trouble
like mismatching parent classes. This also works without reloading.
  • Loading branch information
tvdeyen committed Mar 26, 2018
1 parent 9310998 commit 9deefa3
Showing 1 changed file with 0 additions and 11 deletions.
11 changes: 0 additions & 11 deletions lib/alchemy/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9deefa3

Please sign in to comment.