Skip to content

okkez/annotate_models_with_index

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

AnnotateSchema
==============

Add a comment summarizing the current schema to the top
of each ActiveRecord model source file:

  # Schema as of Sun Feb 26 21:58:32 CST 2006 (schema version 7)
  #
  #  id                  :integer(11)   not null
  #  quantity            :integer(11)   
  #  product_id          :integer(11)   
  #  unit_price          :float         
  #  order_id            :integer(11)   
  #

  class LineItem < ActiveRecord::Base belongs_to :product
  
   . . .
  
Note that this code will blow away the initial comment block in your models if it looks ike it was
previously added by annotate models, so you don't want to add additional text to an automatically
created comment block.

Author:
   Dave Thomas
   Pragmatic Programmers, LLC
   
Released under the same license as Ruby. No Support. No Warranty.

Back up your model files before using...