I currently have the following files in the jobs
directory:
# app/jobs/importer.rb
module Imporer
def self.valid_importers
# Do stuff
end
end
# app/jobs/importer/custom_import_job.rb
class Importer::CustomImportJob < ApplicationJob
def perform
# Do stuff
end
end
This works without issues using the classic code loader, but when switching to Zeitwerk, I get a NameError: uninitialized constant Importer::CustomImportJob
error when running rails zeitwerk:check
.
I tried moving custom_import_job.rb
to the jobs
directory, but still received the same error. Adding app/jobs/importer
to config.autoload_paths
didn't help either.
Is there something wrong with the file structure or am I missing something in the Zeitwerk settings?