We are upgrading to Rails 6, and have done most of the work to make our application work with Zeitwerk.
We do have two files, which are query objects, existing under app/queries and we don't define a class for them. They exists with methods only.
However, Zeitwerk expects the file to define a constant, but we don't deem it necessary.
Is there any way to tell Zeitwerk that we want to load these files as is?
You can tell the main autoloader to ignore them:
And then the application is responsible for loading them using
requireor whatever.If everything under
app/queriesshould be ignored, you can ignore the directory itself: