annotate_models icon indicating copy to clipboard operation
annotate_models copied to clipboard

Annotate namespaced models not working without --models

Open softwaregravy opened this issue 4 years ago • 4 comments

I was trying to get annotate to annotate a new model I created, which is namespaced. It wasn't working. After trying several other things, using the --models caused it to correctly annotate the new model files.

IMHO, this should annotate the models without the --models option.

Commands

$ annotate
$ annotate --models
Annotated (6): ...
$

Version

  • annotate (3.0.3)
  • rails (5.2.3)
  • ruby 2.6.5

softwaregravy avatar Nov 16 '19 21:11 softwaregravy

I had the same problem, but with Rails 6.0.1. A new model was not annotated until I manually ran:

$ annotate --models

It wasn't annotated automatically upon migration, and I had also tried just:

$ annotate

philliplongman avatar Nov 20 '19 06:11 philliplongman

A thought struck me: I had run bundle update today. I checked and Annotate was one of the upgraded gems. I ran rails g annotate:install and overwrote the existing file. It's working correctly now.

philliplongman avatar Nov 20 '19 06:11 philliplongman

Running rails g annotate:install also worked for me.

JoeHampton avatar Dec 11 '19 18:12 JoeHampton

Apologize for the change in expectation. This was also brought up in #663. Right now my priorities on this project is to get the integration tests working before I get back into touching the actual code. Happy to review any PRs for this.

drwl avatar Jan 15 '20 15:01 drwl