« Logging Changes when Saving ActiveRecord Objects | Main | ObjectView »

February 27, 2006

TrackBack

TrackBack URL for this entry:
http://www.typepad.com/services/trackback/6a00d83451c41c69e200d834e11e3c53ef

Listed below are links to weblogs that reference Annotate Models Plugin:

Comments

MartOn

The svn is not working properly. I'm not able to check out the plugin. Has the repository moved?

dailer

In your implementation I found the following regex worked better for me:

content.sub!(/^# #{PREFIX}.*\n(#.*\n)*/, '')

otherwise it required two empty lines after the last comment.

dailer

I also found it was adding an extra space after the inserted comments on each run, so at the end of get_schema_info,

info << "#\n"

instead of

info << "#\n\n"

Gregory Tomei

nice one Dave, thanks! I find this useful

Tim Harper

This is an awesome plugin and I use it on every project.

I have 2 things I always change in it:

First, I take the schema version number out of the annotation, so I don't get a brand new commit for every model everytime I run a migration.

Second, I change the write mode to be "wb" instead of "w" - This ensures that the files are written with unix line-endings, regardless of the platform

Thanks Dave!

Glenn Rempe

Hi,

Cool plugin.

I use Git, and I have it set to check for trailing spaces in my code before commit so I am a bit anal about trailing spaces :-)

I changed line 45 to strip trailing spaces.

from :

info << sprintf("# %-#{max_size}.#{max_size}s:%-15.15s %s\n", col.name, col_type, attrs.join(", "))

to :

info << sprintf("# %-#{max_size}.#{max_size}s:%-15.15s %s\n", col.name, col_type, attrs.join(", ")).gsub(/\s+$/, $/)

Now it works the same, just missing the empty trailing spaces. :-)

Chris

doesn't work with set_table_name

Trdunsworth

I'm having a problem with doing
script/plugin install http://repo.pragprog.com/svn/Public/plugins/annotate_models

I'm getting a Plugin not found return when I try to run this. I'm doing it from Windows (don't gasp please...) and from Ruby 1.8.7 Rails 2.3.5

any suggestions as to why it's not working now and what to do with it?

Thanks,

Verify your Comment

Previewing your Comment

This is only a preview. Your comment has not yet been posted.

Working...
Your comment could not be posted. Error type:
Your comment has been posted. Post another comment

The letters and numbers you entered did not match the image. Please try again.

As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.

Having trouble reading this image? View an alternate.

Working...

Post a comment

Now in Beta

  • Programming Ruby, 3rd Edition
    Third Edition, Covering Ruby 1.9, now available
My Photo

Pragmatic Stuff

Photos

  • www.flickr.com
    This is a Flickr badge showing public photos from pragdave tagged with pragdave_badge. Make your own badge here.

Site Search

  • Google Search

    The web
    PragDave