ctran/annotate_models

Models are not annotated with zeitwerk folder collapsing

Opened this issue · 2 comments

Hi there,

First of all, thanks for the gem :)

There is an issue when I tried to annotate the models outside the app/models
with Zeitwerk folder collapsing.

Steps to reproduce:

  • Put the models under app/components/component_name/models,

  • Have Zeitwerk to collapse such folder

    # in config/application
    Rails.autoloaders.main.collapse("app/components/component_name/models")
  • Add the models folder to the annotate's gem settings

    "model_dir" => "app/models,app/components/component_name/models",
    

When running db:migrate the gem does not annotate the models under app/components/component_name/models

Commands

bundel exec rake db:migrate

Version

  • annotate version: v3.1.1
  • rails version: 6.1.4.3
  • ruby version: 3.0.3

Not sure if this would work for you but similar issue and my solution: #969 (comment)

drwl commented

I took a stab at adding zeitwerk support in my fork, if you want to know more: drwl/annotaterb#82