Class: SpreeMenuChat::Engine

Inherits:
Rails::Engine
  • Object
show all
Defined in:
lib/spree_menu_chat/engine.rb

Class Method Summary collapse

Class Method Details

.activateObject

Force-loads decorator files (the Spree::Product after_commit re-embed hook, added in M2) the same way spree_square's/spree_doordash's engines do — Zeitwerk lazy-autoloading never triggers a decorator file's prepend line otherwise. Kept here from the start even though M1 has no decorator yet, so adding one later doesn't require remembering this step.



37
38
39
40
41
# File 'lib/spree_menu_chat/engine.rb', line 37

def self.activate
  Dir.glob(File.join(File.dirname(__FILE__), '../../app/**/*_decorator*.rb')) do |c|
    Rails.application.config.cache_classes ? require(c) : load(c)
  end
end