Links
Annotate models
Categories
Annotate models
Add a comment summarizing the current schema to the top of each ActiveRecord model source file.
Vitals
| Repository | http://repo.pragprog.com/svn/Public/plugins/annotate_models |
|---|---|
| License | Ruby's |
| Tags |
dsd migrations model notification schema SSModel visualice
|
| Rating | (59 votes) |
| Owner | Dave Thomas |
| Created | 14 April 2006 |
Comments
-
This plugin has a couple of issues.
It can't handle abstract model classes. It can't handle models that descend from ActionMailer::Base.
I was able to get past the abstract model issue but unable to cause the annotation to skip models that descend from ActionMailer::Base.
-
This plugin also updates the annotation for all models when a migration is run. Result is that you end up committing changes to model files that did not really change, except that the migration number incremented.
-
Dave has done it again. I just need to figure out how to automate it when I create a model. I often forget to run ">rake annotate_models" I guess it is time to update my generate script.
-
How can I annotate a model with different name with his table??
-
I cant download this at the moment it just times out, soes does anybody have a local gem or a different svn repository, I think it's a lovely little gem and I want to install it on my new machine and have no source... :( sad developer....
-
This plugin will accept a model name as an argument and only annotate that model, but it really should take MODEL= as an arg instead since rake views that standalone model name as another task to run and pukes a bit (after successfully annotating that single model)
-
SVN repository url is incorrect. It should be:
http://repo.pragprog.com/svn/Public/plugins/annotate_models
-
I've updated this plugin at
http://pastie.caboo.se/120982
It now (a) doesn't truncate long SQL types like "DECIMAL (10, 2)", (b) omits annoying "Skipping X" messages, (c) displays all models annotated on a single line, not one line per model, for more concise output. I also recommend putting this as a dependency inside your "rake all" task (or whatever you run just before checking in) so that the changelist that made the migration change has all the annotation changes in it as well.
- alex@pivotallabs.com
-
I've incorporated the change from Alex and converted the whole thing into a gem and sake task, for those interested. Check it out at http://github.com/ctran/annotate_models
-
I patched this so it doesn't update files where only the version number has changed.
See http://pastie.org/348086

