Plugins - Annotate models

StarAdd to favorites

Add a comment summarizing the current schema to the top of each ActiveRecord model source file.

Dave Thomas

http://repo.pragprog.com/svn/Public/plugins/annotate_models

Ruby's

  • Currently 4.6/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Model

Tags

Comments

Add a comment
ctran 28 Feb 2008

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

Alex Chaffee 22 Nov 2007

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
Will Green 14 Nov 2007

SVN repository url is incorrect. It should be:

http://repo.pragprog.com/svn/Public/plugins/annotate_models

bill pratt 8 Aug 2007

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)

Julian Guppy 4 Jun 2007

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....

winson 4 May 2007

How can I annotate a model with different name with his table??

Amos 23 Feb 2007

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.

Kevin 31 Aug 2006

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.

Wes Gamble 12 Jul 2006

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.

Search Plugins

Query syntax

Plugins by Category

Sponsors

Rails Kits: Get Code. Get Moving.
Recruiting software

Have a comment?