DEV Community

Samuel Lubliner
Samuel Lubliner

Posted on • Edited on

Annotate Gem

db/schema.rb

  • Contains the record of the database.
  • NEVER edit this file
  • It is auto-generated from running

rake db:migrate

Instead of constantly referencing db/schema.rb, install the annotate gem.

Add the gem to the :development group of the Gemfile.

bundle install

annotate --models

This creates a rake task file lib/tasks/auto_annotate_models.rake

rake db:migrate runs the annotation automatically.

Now at the top of app/models/like.rb, see the annotations.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more