Skip to content

Commit

Permalink
use load when loading static service models
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrock committed Dec 1, 2023
1 parent 47e20cc commit 98f2ecf
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,9 @@ def self.find_or_create_service_model(ar_model)
def self.create_service_model(ar_model)
file_path = model_to_file_path(ar_model)
if File.exist?(file_path)
require file_path
# class reloading in development causes require to no-op when it should load
# since we will never require this file, using load is not a big loss
load file_path
::MiqAeMethodService.const_get(model_to_service_model_name(ar_model))
else
dynamic_service_model_creation(ar_model, service_model_superclass(ar_model))
Expand Down

0 comments on commit 98f2ecf

Please sign in to comment.