Every repository with this icon (
Every repository with this icon (
tree 460a2685cac06615797e9f5860314463abab712c
parent 78610bfbf5854cede1430259b7461f9cf1e99120
| name | age | message | |
|---|---|---|---|
| |
.gitignore | Tue Feb 03 16:50:19 -0800 2009 | |
| |
History.txt | Tue Feb 03 16:50:19 -0800 2009 | |
| |
License.txt | Thu Feb 28 14:33:52 -0800 2008 | |
| |
Manifest.txt | Wed Nov 18 02:40:49 -0800 2009 | |
| |
README.rdoc | Tue Feb 03 17:01:31 -0800 2009 | |
| |
Rakefile | Sun Feb 08 14:36:35 -0800 2009 | |
| |
annotate_models.gemspec | ||
| |
bin/ | Wed Feb 11 17:18:43 -0800 2009 | |
| |
config/ | Fri Feb 29 11:40:21 -0800 2008 | |
| |
lib/ | ||
| |
log/ | Wed Feb 27 10:06:49 -0800 2008 | |
| |
script/ | Wed Nov 18 02:39:24 -0800 2009 | |
| |
setup.rb | Wed Feb 27 10:06:49 -0800 2008 | |
| |
spec/ | Tue Feb 03 16:50:19 -0800 2009 | |
| |
tasks/ | Tue Feb 03 16:50:19 -0800 2009 | |
| |
test/ | Wed Feb 27 10:06:49 -0800 2008 | |
| |
website/ | Fri May 02 21:25:35 -0700 2008 |
AnnotateModels
Add a comment summarizing the current schema to the bottom of each ActiveRecord model, fixture file.
If you are using Object Daddy, it`ll annotate your example files too.
# == Schema Info
#
# Table name: line_items
#
# id :integer(11) not null, primary key
# quantity :integer(11) not null
# product_id :integer(11) not null
# unit_price :float
# order_id :integer(11)
#
class LineItem < ActiveRecord::Base
belongs_to :product
. . .
Annotates geometrical columns, geom type and srid, when using SpatialAdapter or PostgisAdapter:
# == Schema Info # # Table name: trips # # local :geometry point, 4326 # path :geometry line_string, 4326
Warning
Note that this code will blow away the initial/final comment block in your models if it looks like it was previously added by annotate models, so you don’t want to add additional text to an automatically created comment block.
* * Back up your model files before using... * *
Install
From rubyforge:
sudo gem install annotate
From github:
gem sources -a http://gems.github.com sudo gem install ctran-annotate
Usage
To annotate all your models:
cd /path/to/app annotate
To annotate routes.rb:
annotate -r
More:
annotate -h
Add annotation at the beginning or end of the file:
annotate -p [before|after]
Remove annotations:
annotate -d
LICENSE:
Released under the same license as Ruby. No Support. No Warranty.
Author:
Original code by:
Dave Thomas -- Pragmatic Programmers, LLC
Modifications by:
- alex@pivotallabs.com - Cuong Tran - http://github.com/ctran - Jack Danger - http://github.com/JackDanger - Michael Bumann - http://github.com/bumi - Henrik Nyh - http://github.com/henrik - Marcos Piccinini - http://github.com/nofxx
and many others that I may have missed to add.








