Skip to content

Commit

Permalink
Merge pull request #275 from ctran/auto-annotate-docs
Browse files Browse the repository at this point in the history
more documentation for auto-annotate and rake tasks
  • Loading branch information
ctran committed Sep 9, 2015
2 parents 9067816 + 3c11de6 commit 2e555f0
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions README.rdoc
Expand Up @@ -51,7 +51,7 @@ Also, if you pass the -r option, it'll annotate routes.rb with the output of

Into Gemfile from rubygems.org:

gem 'annotate', '~> 2.6.10'
gem 'annotate'

Into Gemfile from Github:

Expand Down Expand Up @@ -100,9 +100,7 @@ To remove routes.rb annotations:

annotate --routes --delete


== Configuration

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.

=== Usage Outside of Rails

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



== Configuration

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

== Rails Integration
The generated rakefile +lib/tasks/auto_annotate_models.rake+ also contains
`Annotate.load_tasks`. This adds a few rake tasks which duplicate command-line
functionality:

rake annotate_models # Add schema information (as comments) to model and fixture files
rake annotate_routes # Adds the route map to routes.rb
rake remove_annotation # Remove schema information from model and fixture files

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

0 comments on commit 2e555f0

Please sign in to comment.