From be8f88df4fab2137bed91706dc588a49a4462478 Mon Sep 17 00:00:00 2001 From: Benjamin ter Kuile Date: Tue, 1 Feb 2022 08:12:11 -0500 Subject: [PATCH] Commit loading order fix --- lib/dunlop/engine.rb | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/lib/dunlop/engine.rb b/lib/dunlop/engine.rb index daa5c21..1ada916 100644 --- a/lib/dunlop/engine.rb +++ b/lib/dunlop/engine.rb @@ -36,13 +36,6 @@ module Dunlop class Engine < ::Rails::Engine isolate_namespace Dunlop - #TODO this generates noise and pollutes API based implementations (Like Panda) - initializer 'dunlop.action_controller' do |app| - ActiveSupport.on_load :action_controller do - helper ::Dunlop::ApplicationHelper if respond_to?(:helper) - end - end - initializer "dunlop.ability", group: 'dunlop' do |app| if ability_class = "Ability".safe_constantize and ability_class.respond_to?(:add_dunlop_allowed_authorization_classes!) ability_class.add_dunlop_allowed_authorization_classes! @@ -59,6 +52,11 @@ module Dunlop end config.after_initialize do + #TODO this generates noise and pollutes API based implementations (Like Panda) + ActiveSupport.on_load :action_controller do + helper ::Dunlop::ApplicationHelper if respond_to?(:helper) + end + # Auto generate target-file's ::Job classes having purpose triggering .generate on the class ::Dunlop.target_file_models.each do |target_file_base_model| ## Generte a job for all target files