merb_annotate_models
====================
A plugin for the Merb framework that provides a port of the rails
annotate models plugin.
Right now this plugin only works with activerecord as the ORM.
using with merb
===============
Install with
# svn co http://merb-annotate-models.googlecode.com/svn/trunk/ merb_annotate_models
# cd merb_annotate_models
# rake package
# gem install pkg/merb_annotate_models-x.x.x.gem
Include it in Merb in your dependencies.rb file in the config dir
dependency "merb_annotate_models"
This will give you a rake task to run.
$ rake -T annotate
rake annotate:models # Annotate The Models
$ rake annotate:models
Annotating Tag
Annotating User
examples
========
Say you had a tag model, where the migration looked like this:
class AddModelTags < ActiveRecord::Migration
def self.up
create_table :tags do |t|
t.column :name, :string
t.column :owner_id, :integer
t.column :owner_type, :string
t.column :created_at, :timestamp
t.column :updated_at, :timestamp
end
end
def self.down
drop_table :tags
end
end
When you run annotate models it will place something like this
on the top of your tag.rb file.
# == Schema Information
# Schema version: 19
#
# Table name: tags
#
# id :integer(11) not null, primary key
# name :string(255)
# owner_id :integer(11)
# owner_type :string(255)
# created_at :datetime
# updated_at :datetime
#