Skip to content

Zeitwerk: Use #load over #require_dependency for decorators#86

Merged
tvdeyen merged 1 commit intosolidusio:mainfrom
mamhoff:use-load-over-require-dependency
Nov 20, 2024
Merged

Zeitwerk: Use #load over #require_dependency for decorators#86
tvdeyen merged 1 commit intosolidusio:mainfrom
mamhoff:use-load-over-require-dependency

Conversation

@mamhoff
Copy link
Contributor

@mamhoff mamhoff commented Nov 20, 2024

According to the Rails Guide for Engines, in order to change functionality in an Engine at runtime, we should be using load. require_dependency is outdated. Here's the Rails guide from version 6.1, which is the last one that has require_dependency (only for the "classic" autoloading mode.

https://guides.rubyonrails.org/v6.1/engines.html#overriding-models-and-controllers

According to the Rails Guide for Engines, in order to change
functionality in an Engine at runtime, we should be using `load`.
`require_dependency` is outdated. Here's the Rails guide from version
6.1, which is the last one that has `require_dependency` (only for the
"classic" autoloading mode.

https://guides.rubyonrails.org/v6.1/engines.html#overriding-models-and-controllers
Copy link
Member

@tvdeyen tvdeyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks

@tvdeyen tvdeyen merged commit ad0feba into solidusio:main Nov 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants