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

How to generate annotation for a single model #214

Closed
justin808 opened this issue Nov 2, 2014 · 6 comments
Closed

How to generate annotation for a single model #214

justin808 opened this issue Nov 2, 2014 · 6 comments
Assignees
Labels
Milestone

Comments

@justin808
Copy link

I tried

annotate --exclude tests,fixtures,factories -i app/models/my_model.rb

and

annotate --exclude tests,fixtures,factories -i MyModel

and in both cases, all models are annotated.

@ctran
Copy link
Owner

ctran commented Nov 2, 2014

Please include ruby version and annotate version.

@justin808
Copy link
Author

Ruby 2.1.3

~/.rvm/gems/ruby-2.1.3@paynearme/gems/annotate-2.6.5

@justin808
Copy link
Author

@ctran What should the correct syntax be? Any work around. I'm dealing with an app that has 130 tables!

@zeade
Copy link

zeade commented Nov 19, 2014

Same problem, ruby v2.1.5, annotate v2.6.5.

Pretty sure this is the culprit: https://github.com/ctran/annotate_models/blob/develop/lib/annotate/annotate_models.rb#L346

Hacky work-around: putting random characters in front of a real model file will run annotate on the real model, for example the following command will ignore "invalid-non-whitespace" and run on just "valid_thing.rb":

annotate --exclude tests,fixtures,factories invalid-non-whitespace valid_thing.rb

Separate problem, annotate does not seem to understand relative path names to a file e.g. app/models/valid_thing.rb is not found but valid_thing.rb is found.

@ctran ctran added the bug label Mar 8, 2015
@ctran ctran added this to the v2.6.6 milestone Mar 8, 2015
@ctran ctran self-assigned this Mar 8, 2015
@ctran
Copy link
Owner

ctran commented Mar 8, 2015

Looks like a bug. I have a fix for this.

@ctran ctran closed this as completed in 9407dc6 Mar 8, 2015
@deepakmahakale
Copy link

This works

annotate app/models/valid_thing.rb

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

No branches or pull requests

4 participants