Skip to content

Commit 98f2ecf

Browse files
committed
use load when loading static service models
1 parent 47e20cc commit 98f2ecf

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ def self.find_or_create_service_model(ar_model)
129129
def self.create_service_model(ar_model)
130130
file_path = model_to_file_path(ar_model)
131131
if File.exist?(file_path)
132-
require file_path
132+
# class reloading in development causes require to no-op when it should load
133+
# since we will never require this file, using load is not a big loss
134+
load file_path
133135
::MiqAeMethodService.const_get(model_to_service_model_name(ar_model))
134136
else
135137
dynamic_service_model_creation(ar_model, service_model_superclass(ar_model))

0 commit comments

Comments
 (0)