Skip to content

Commit a1818d7

Browse files
committed
Run bin/rails g annotate_rb:install
Adds a rake task into your Rails project's lib/tasks directory that will hook into the Rails project rake tasks, automatically running AnnotateRb after database migration rake tasks. To skip the automatic annotation that happens after a db task, pass the environment variable ANNOTATERB_SKIP_ON_DB_TASKS=1 before your command. $ ANNOTATERB_SKIP_ON_DB_TASKS=1 bin/rails db:migrate
1 parent 016394a commit a1818d7

File tree

2 files changed

+66
-0
lines changed

2 files changed

+66
-0
lines changed

.annotaterb.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
---
2+
:position: before
3+
:position_in_additional_file_patterns: before
4+
:position_in_class: before
5+
:position_in_factory: before
6+
:position_in_fixture: before
7+
:position_in_routes: before
8+
:position_in_serializer: before
9+
:position_in_test: before
10+
:classified_sort: true
11+
:exclude_controllers: true
12+
:exclude_factories: false
13+
:exclude_fixtures: false
14+
:exclude_helpers: true
15+
:exclude_scaffolds: true
16+
:exclude_serializers: false
17+
:exclude_sti_subclasses: false
18+
:exclude_tests: false
19+
:force: false
20+
:format_markdown: false
21+
:format_rdoc: false
22+
:format_yard: false
23+
:frozen: false
24+
:ignore_model_sub_dir: false
25+
:ignore_unknown_models: false
26+
:include_version: false
27+
:show_check_constraints: false
28+
:show_complete_foreign_keys: false
29+
:show_foreign_keys: true
30+
:show_indexes: true
31+
:simple_indexes: false
32+
:sort: false
33+
:timestamp: false
34+
:trace: false
35+
:with_comment: true
36+
:with_column_comments: true
37+
:with_table_comments: true
38+
:active_admin: false
39+
:command:
40+
:debug: false
41+
:hide_default_column_types: ''
42+
:hide_limit_column_types: ''
43+
:ignore_columns:
44+
:ignore_routes:
45+
:models: true
46+
:routes: false
47+
:skip_on_db_migrate: false
48+
:target_action: :do_annotations
49+
:wrapper:
50+
:wrapper_close:
51+
:wrapper_open:
52+
:classes_default_to_s: []
53+
:additional_file_patterns: []
54+
:model_dir:
55+
- app/models
56+
:require: []
57+
:root_dir:
58+
- ''

lib/tasks/annotate_rb.rake

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This rake task was added by annotate_rb gem.
2+
3+
# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this
4+
if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil?
5+
require "annotate_rb"
6+
7+
AnnotateRb::Core.load_rake_tasks
8+
end

0 commit comments

Comments
 (0)