Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Avoid using require_dependency is Zeitwerk is enabled #37599

Merged

Conversation

casperisfine
Copy link
Contributor

Context

I'm trying to disable config.add_autoload_paths_to_load_path in our app, which cause require_dependency to straight up fail when called with an autoloaded path.

These were added in 1e55ee5 to workaround the classic autoloader limitations, but that's no longer a problem with Zeitwerk.

I'm not super happy with adding this kind of global config check in there, but I can't think of a better way.

@fxn, cc @eugeneius

cc @rafaelfranca @Edouard-chin @etiennebarrie

@rafaelfranca
Copy link
Member

I'm merging but feel free to comment if you think there is a better way to do it.

@rafaelfranca rafaelfranca merged commit 5bbf047 into rails:master Oct 30, 2019
@fxn
Copy link
Member

fxn commented Oct 30, 2019

👍

@fxn
Copy link
Member

fxn commented Oct 31, 2019

Cherry-picked to 6-0-stable.

@fxn
Copy link
Member

fxn commented Apr 29, 2020

I'd like to remove require_dependency from the code base, so I've rewritten this to use constant paths instead, see c7c3abe.

I have not forgotten the occurrence in helper, but need time to find a solution that I like. My desire would be to deprecate anything but module objects or blocks as arguments, but have to figure out helper :all, which cannot be deprecated, it has to be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants