-
Notifications
You must be signed in to change notification settings - Fork 81
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
Class loader Issue MaintenanceTasks::CsvCollectionBuilder #642
Comments
Yeah we've noticed in #620 and dropped support for it for v2.0.0. I've also tried adding an inflection in ActiveSupport::Inflector.inflections(:en) do |inflect|
inflect.acronym "CSV"
end Can you give me repro steps? From there we should be able to require the file and avoid the eager-loading issue. |
Here are some reproduction steps with rails 6.1.7, but under Zeitwerk: rails new testapp --skip-webpack-install --skip-javascript Flip Then edit ActiveSupport::Inflector.inflections do |inflect|
inflect.acronym 'CSV'
end And finally add When you try to launch a console, it'll crash. This is due to the fact that Rails doesn't isolate inflections to the main application, thus requiring something like: Rails.autoloaders.each do |autoloader|
autoloader.inflector.inflect(
'batch_csv_collection_builder' => 'BatchCsvCollectionBuilder',
'csv_collection_builder' => 'CsvCollectionBuilder',
)
end |
Cheers @drcapulet. For anyone curious about the zeitwerk inflections mentioned in #642 (comment)
|
This issue has been marked as stale because it has not been commented on in two months. |
As I turn on the eager loader and start the rails console I receive this error:
This is my ruby version:
The text was updated successfully, but these errors were encountered: