README.rdoc in annotate-2.6.10 vs README.rdoc in annotate-2.7.0

- old
+ new

@@ -49,11 +49,11 @@ == Install Into Gemfile from rubygems.org: - gem 'annotate', '~> 2.6.6' + gem 'annotate' Into Gemfile from Github: gem 'annotate', github: 'ctran/annotate_models' @@ -98,23 +98,20 @@ To remove routes.rb annotations: annotate --routes --delete +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. -== Configuration - - === Usage Outside of Rails Everything above applies, except that +--routes+ is not meaningful, and you will probably need to explicitly set one or more +--require+ option(s), and/or one 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 anywhere in the file: @@ -128,10 +125,16 @@ rails g annotate:install 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). If you want to disable this behavior permanently, edit the +.rake+ file and change: