Skip to content
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

Models are not annotated with zeitwerk folder collapsing #921

Open
bnguyen-block opened this issue Jan 17, 2022 · 2 comments
Open

Models are not annotated with zeitwerk folder collapsing #921

bnguyen-block opened this issue Jan 17, 2022 · 2 comments

Comments

@bnguyen-block
Copy link

bnguyen-block commented Jan 17, 2022

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
@ilvez
Copy link

ilvez commented Feb 7, 2024

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

@drwl
Copy link
Collaborator

drwl commented Feb 13, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants