tech-angels / annotator

Keep model fields commented in your rails apps.
MIT License
64 stars 5 forks source link

Problem traversing models (could be namespacing issue?) #2

Closed dougc84 closed 12 years ago

dougc84 commented 12 years ago

I have a application that I thought would be perfect for this gem. I've typically used awesome_print on a model name, taken that output, and dropped it into a comment at the top of each model. That's worked pretty successfully. However, I have something like 50+ database tables and models in the app I am currently working on (very complex app), and the only way to keep things managed is to use namespaced models.

The only two models that aren't namespaced is User (provided by Devise) and Friendship (provided by Amistad... awesome little gem). It looks like those are the only two that are actually processed, and running rake annotate --trace shows no errors.

I assume this is a namespacing issue - I'd try to hack the code, but I'm too slammed at the moment. Any idea if this will ever be implemented?

Additionally, it would be great if the comments were tabbed and spaced out. :)

Otherwise, awesome little gem. I can definitely see using this all over the place in the future.

comboy commented 12 years ago

@dougc84 Namespaced models will be supported. I'm at euruko conf at the moment, if you would like to hack the feature in yourself, you are very welcome, although I would probably prefer to push a bit of rewrite first. I'm a bit ashamed of a functional manner in which this gem is written.

Regarding spacing out comment - you mean like aligning them in a way that every comment line starts from the same column? It sounds like it could be more readable indeed, but with just one long column name or it's type description, or comments would have very little space. Something like "* created_at [datetime, not null] -" is ~40 chars, and lines are broken after 120 chars currently. However line limit could be raised or optional then. I guess it's worth adding, at least as an option.

comboy commented 12 years ago

@dougc84 could you check if master works for you?

comboy commented 12 years ago

closing this one, please open new one for spaced out comments if you think it would be a good idea