ctran / annotate_models

Annotate Rails classes with schema and routes info
Other
4.41k stars 600 forks source link

model_dir Not working on rails 6.1 #850

Open edugonch opened 3 years ago

edugonch commented 3 years ago

I have an app with an engine, I add the engine dir to model_dir configuration. 'model_dir' => "app/models,components/core/app/models/core",

When trying to annotate the models nothing happen

Commands

$ rails annotate_models
Model files unchanged.
$ rails annotate_models --model-dir 'components/core/app/models/core'
invalid option: --model-dir
$ rails annotate
rails aborted!
Don't know how to build task 'annotate' (See the list of available tasks with `rails --tasks`)
Did you mean?  annotate_routes

Version

jurriaanschrofer commented 3 years ago

Hi edugonch,

After running into many problems with annotate myself, I have developed the gem datagaze which fixes those issues.

I expect that the gem might also resolve your issue. Would you like to try it out, and let me know if it has solved your problem?

The gem is to be found at: https://github.com/jurriaanschrofer/datagaze.

Background story of the gem: annotate's lookup system is often rigid and based on very strict conventions. Instead, I have devised a more dynamic way of annotating, through the use of ruby's const_source_location method and rails' ApplicationRecord.descendants.

autotelik commented 1 year ago

Similar issue still with Rails 7. Have pretty standard engine, with migrations and models. Nothing happens whatever options I try for --models --model-dir - always ends with "Model files unchanged."