jbbarth / redmine_base_deface

Integrate with the deface gem to manage view modifications in plugins
MIT License
40 stars 34 forks source link

Fix using classic autoloader in Rails 6.x #15

Open SolarBear opened 8 months ago

SolarBear commented 8 months ago

While Rails up to 5 will use the classic autoloader and Rails 7+ will use zeitwerk, Rails 6.x can still be configured to use the classic autoloader: in that case, the code with throw an exception as it expects the latter behavior.

By adding a call to zeitwerk_enabled?, we support both cases, while having no impact on other Rails versions.

See Rails 7's and Rails 6's docs for more information.