Skip to content

Commit

Permalink
Merge pull request #536 from kbrock/const_get
Browse files Browse the repository at this point in the history
Const get

(cherry picked from commit 9e3f656)
  • Loading branch information
Fryguy committed Dec 11, 2023
1 parent 4ce5563 commit 5f47ecb
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ def self.create_service_model_from_name(name)
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
model_name_from_active_record_model(ar_model).safe_constantize
else
dynamic_service_model_creation(ar_model, service_model_superclass(ar_model))
Expand Down

0 comments on commit 5f47ecb

Please sign in to comment.