annotated-rails Build Status

Provides schema annotation for your models.

Like this:

class Post < ActiveRecord::Base
  ...
end
#--
# generated by 'annotated-rails' gem, please do not remove this line and content below, instead use `bundle exec annotate-rails -d` command
#++
# Table name: posts
#
# * id             :integer         not null
#   title          :string(30)
#   content        :text
#   slug           :string(255)     not null
#   author_name    :string(255)
#   comments_count :integer         default 0
#   created_at     :datetime        not null
#   updated_at     :datetime        not null
#
#  Indexes:
#   index_posts_on_slug  slug
#--
# generated by 'annotated-rails' gem, please do not remove this line and content above, instead use `bundle exec annotate-rails -d` command
#++

Inspired by ctran/annotate_models

For using with 3.x rails, do not tested against earlier versions.

Installation

Add this line to your rails Gemfile:

group :development do
  gem 'annotated-rails'
end

And then execute:

$ bundle

Usage

  • First way: almost do nothing, your rake db:migrate or similar database-changing tasks will do the job if gem already installed.

  • Second way: use guard and guard-migrate and for you nothing to do at all :).

  • Third way (to use from commandline):

To annotate:

  bundle exec annotate-rails

To remove annotation:

  bundle exec annotate-rails -d

To see CLI help:

  bundle exec annotate-rails -h|--help

Future plans

  • look at the CHANGELOG for what is going to be done
  • add annotations for other things

Testing

  • clone
  • bundle
  • rake

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Added some feature')
  4. Add tests for your changes
  5. Push to the branch (git push origin my-new-feature)
  6. Create new Pull Request