Opinionated Annotate Config

Public
Annotate Rails classes with schema
Used 1 time
Created by
d dpaluy

Usage

Run this command in your Rails app directory in the terminal:

rails app:template LOCATION="https://railsbytes.com/script/X6ksWY"
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 every time you run db:migrate?")
  run("rails g annotate:install")
end

run "touch .annotaterb.yml"

inject_into_file ".annotaterb.yml" do <<~EOF
# AnnotateRb configuration
position: bottom
position_in_additional_file_patterns: before
position_in_class: bottom
position_in_factory: bottom
position_in_fixture: bottom
classified_sort: true
exclude_controllers: true
exclude_factories: true
exclude_fixtures: true
exclude_helpers: true
exclude_scaffolds: true
exclude_serializers: true
exclude_sti_subclasses: false
exclude_tests: true
exclude: tests,fixtures,db/migrate
force: false
format_markdown: false
format_rdoc: false
format_yard: false
frozen: false
ignore_model_sub_dir: false
ignore_unknown_models: false
include_version: false
show_check_constraints: false
show_complete_foreign_keys: false
show_foreign_keys: true
show_indexes: true
simple_indexes: false
sort: false
timestamp: false
trace: false
with_comment: true
with_column_comments: true
with_table_comments: true
models: true
routes: false
fixtures: false
skip_on_db_migrate: false
EOF
end
Comments

Sign up or Login to leave a comment.