Skip to content

Commit

Permalink
fix reload!
Browse files Browse the repository at this point in the history
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 `<top (required)>'
        3: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:4:in `<module:MiqAeMethodService>'
        2: from lib/miq_automation_engine/engine/miq_ae_method_service/miq_ae_service_model_base.rb:13:in `<class:MiqAeServiceModelBase>'
        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
>
```
  • Loading branch information
kbrock committed May 29, 2020
1 parent ee70c81 commit f271b70
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/miq_automation_engine/engine/miq_ae_method_service.rb
Original file line number Diff line number Diff line change
@@ -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
Expand Down

0 comments on commit f271b70

Please sign in to comment.