From f271b70ddafb5ae19403e6f361a74e42378210ce Mon Sep 17 00:00:00 2001 From: Keenan Brock Date: Fri, 29 May 2020 13:07:22 -0400 Subject: [PATCH] fix reload! after reload classes don't exist. and that includes what we were delegating for the class missing before: ``` > reload! Traceback (most recent call last): 16: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:510:in `load_missing_constant' 15: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:356:in `require_or_load' 14: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:37:in `load_interlock' 13: from activesupport (5.2.4.3) lib/active_support/dependencies/interlock.rb:13:in `loading' 12: from activesupport (5.2.4.3) lib/active_support/concurrency/share_lock.rb:151:in `exclusive' 11: from activesupport (5.2.4.3) lib/active_support/dependencies/interlock.rb:14:in `block in loading' 10: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:37:in `block in load_interlock' 9: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:373:in `block in require_or_load' 8: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:475:in `load_file' 7: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:661:in `new_constants_in' 6: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:476:in `block in load_file' 5: from activesupport (5.2.4.3) lib/active_support/dependencies.rb:476:in `load' 4: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:3:in `' 3: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:4:in `' 2: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:13:in `' 1: from lib/miq_automation_engine/engine/miq_ae_method_service.rb:12:in `const_missing' NoMethodError (undefined method `create_service_model_from_name' for MiqAeMethodService::MiqAeServiceModelBase:Class) ``` after: ``` > reload! sure thing. coming right up > ``` --- lib/miq_automation_engine/engine/miq_ae_method_service.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/miq_automation_engine/engine/miq_ae_method_service.rb b/lib/miq_automation_engine/engine/miq_ae_method_service.rb index b0f668a1e..09fba1d5c 100644 --- a/lib/miq_automation_engine/engine/miq_ae_method_service.rb +++ b/lib/miq_automation_engine/engine/miq_ae_method_service.rb @@ -1,6 +1,6 @@ module MiqAeMethodService def self.const_missing(name) - super unless defined?(MiqAeServiceModelBase) + return super unless defined?(MiqAeServiceModelBase) MiqAeServiceModelBase.create_service_model_from_name(name) || super end