Annotate Models
Annotate Rails classes with schema and routes info
Used 432 times
D
Drew Reynolds
Usage
Run this command in your Rails app directory in the terminal:
rails app:template LOCATION="https://railsbytes.com/script/Vqqsqg"
Template Source
Review the code before running this template on your machine.
gem_group :development do
gem 'annotate'
end
if yes?("Would you like to annotate all your models, tests, fixtures, and factories?")
run("annotate")
else
if yes?("Would you like to annotate just your models?")
run("annotate --models")
end
if yes?("Would you like to annotate just your routes?")
run("annotate --routes")
end
end
if yes?("Would you like to annotate every time you run db:migrate?")
run("rails g annotate:install")
end