Skip to content

Commit ce338bf

Browse files
authored
Fix the default behavior for model annotator (#20)
In a previous change, I removed the following options from having their defaults set: ```ruby :exclude_controllers :exclude_factories :exclude_fixtures :exclude_helpers :exclude_scaffolds :exclude_serializers :exclude_tests ``` These actually get used in `lib/annotate_rb/model_annotator/model_file_annotator.rb:94` but weren't easily grep-able. This led to controllers, helpers, etc being annotated by default when they should have not been.
1 parent 4fac6fa commit ce338bf

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

lib/annotate_rb/options.rb

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -26,14 +26,14 @@ def from(options = {}, state = {})
2626

2727
FLAG_OPTIONS = {
2828
classified_sort: true, # ModelAnnotator
29-
exclude_controllers: true, # Unused
30-
exclude_factories: false, # Unused
31-
exclude_fixtures: false, # Unused
32-
exclude_helpers: true, # Unused
33-
exclude_scaffolds: true, # Unused
34-
exclude_serializers: false, # Unused
29+
exclude_controllers: true, # ModelAnnotator
30+
exclude_factories: false, # ModelAnnotator
31+
exclude_fixtures: false, # ModelAnnotator
32+
exclude_helpers: true, # ModelAnnotator
33+
exclude_scaffolds: true, # ModelAnnotator
34+
exclude_serializers: false, # ModelAnnotator
3535
exclude_sti_subclasses: false, # ModelAnnotator
36-
exclude_tests: false, # Unused
36+
exclude_tests: false, # ModelAnnotator
3737
force: false, # ModelAnnotator, but should be used by both
3838
format_bare: true, # Unused
3939
format_markdown: false, # ModelAnnotator, RouteAnnotator
@@ -59,10 +59,10 @@ def from(options = {}, state = {})
5959
debug: false, # Core
6060

6161
# ModelAnnotator
62-
hide_default_column_types: '<%= ::AnnotateRb::ModelAnnotator::SchemaInfo::NO_DEFAULT_COL_TYPES.join(",") %>',
62+
hide_default_column_types: '',
6363

6464
# ModelAnnotator
65-
hide_limit_column_types: '<%= ::AnnotateRb::ModelAnnotator::SchemaInfo::NO_LIMIT_COL_TYPES.join(",") %>',
65+
hide_limit_column_types: '',
6666

6767
ignore_columns: nil, # ModelAnnotator
6868
ignore_routes: nil, # RouteAnnotator
@@ -95,7 +95,14 @@ def from(options = {}, state = {})
9595

9696
FLAG_OPTION_KEYS = [
9797
:classified_sort,
98+
:exclude_controllers,
99+
:exclude_factories,
100+
:exclude_fixtures,
101+
:exclude_helpers,
102+
:exclude_scaffolds,
103+
:exclude_serializers,
98104
:exclude_sti_subclasses,
105+
:exclude_tests,
99106
:force,
100107
:format_markdown,
101108
:format_rdoc,

0 commit comments

Comments
 (0)