Skip to content

Commit 2e555f0

Browse files
committed
Merge pull request #275 from ctran/auto-annotate-docs
more documentation for auto-annotate and rake tasks
2 parents 9067816 + 3c11de6 commit 2e555f0

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

README.rdoc

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ Also, if you pass the -r option, it'll annotate routes.rb with the output of
5151

5252
Into Gemfile from rubygems.org:
5353

54-
gem 'annotate', '~> 2.6.10'
54+
gem 'annotate'
5555

5656
Into Gemfile from Github:
5757

@@ -100,9 +100,7 @@ To remove routes.rb annotations:
100100

101101
annotate --routes --delete
102102

103-
104-
== Configuration
105-
103+
To automatically annotate every time you run +db:migrate+, either run +rails g annotate:install+ or add +Annotate.load_tasks+ to your `Rakefile`. See the [configuration in Rails](#configuration-in-rails) section for more info.
106104

107105
=== Usage Outside of Rails
108106

@@ -112,7 +110,6 @@ or more +--model-dir+ options to inform annotate about the structure of your
112110
project and help it bootstrap and load the relevant code.
113111

114112

115-
116113
== Configuration
117114

118115
If you want to always skip annotations on a particular model, add this string
@@ -130,7 +127,13 @@ default options:
130127
Edit this file to control things like output format, where annotations are
131128
added (top or bottom of file), and in which artifacts.
132129

133-
== Rails Integration
130+
The generated rakefile +lib/tasks/auto_annotate_models.rake+ also contains
131+
`Annotate.load_tasks`. This adds a few rake tasks which duplicate command-line
132+
functionality:
133+
134+
rake annotate_models # Add schema information (as comments) to model and fixture files
135+
rake annotate_routes # Adds the route map to routes.rb
136+
rake remove_annotation # Remove schema information from model and fixture files
134137

135138
By default, once you've generated a configuration file, annotate will be
136139
executed whenever you run +rake db:migrate+ (but only in development mode).

0 commit comments

Comments
 (0)