Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
annotate_models rewritten from scratch
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
bin
lib
spec
.gitignore
.rspec
.travis.yml
.yardopts
CHANGELOG.md
Gemfile
LICENSE
README.md
Rakefile
annotated-rails.gemspec gem runtime dependency

README.md

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
Something went wrong with that request. Please try again.