From 5b5f9aa372a7c81559f59ff708cad826775a149f Mon Sep 17 00:00:00 2001 From: Jon Rowe Date: Fri, 20 Oct 2023 10:50:19 +0200 Subject: [PATCH] Configure Zeitwerk to ignore our generator --- example_app_generator/generate_stuff.rb | 1 + .../no_active_record/config/initializers/zeitwerk.rb | 3 +++ 2 files changed, 4 insertions(+) create mode 100644 example_app_generator/no_active_record/config/initializers/zeitwerk.rb diff --git a/example_app_generator/generate_stuff.rb b/example_app_generator/generate_stuff.rb index b1aca9187..9f5c04fd3 100644 --- a/example_app_generator/generate_stuff.rb +++ b/example_app_generator/generate_stuff.rb @@ -32,6 +32,7 @@ def source_paths end def setup_tasks + copy_file 'config/initializers/zeitwerk.rb' copy_file 'app/models/in_memory/model.rb' copy_file 'lib/rails/generators/in_memory/model/model_generator.rb' copy_file 'lib/rails/generators/in_memory/model/templates/model.rb.erb' diff --git a/example_app_generator/no_active_record/config/initializers/zeitwerk.rb b/example_app_generator/no_active_record/config/initializers/zeitwerk.rb new file mode 100644 index 000000000..2156c9eec --- /dev/null +++ b/example_app_generator/no_active_record/config/initializers/zeitwerk.rb @@ -0,0 +1,3 @@ +if Rails.autoloads.main + Rails.autoloaders.main.ignore('lib/rails/generators/in_memory/model/model_generator.rb') +end