|
| 1 | +# NOTE: only doing this in development as some production environments (Heroku) |
| 2 | +# NOTE: are sensitive to local FS writes, and besides -- it's just not proper |
| 3 | +# NOTE: to have a dev-mode tool do its thing in production. |
| 4 | +if Rails.env.development? |
| 5 | + require 'annotate' |
| 6 | + task :set_annotation_options do |
| 7 | + # You can override any of these by setting an environment variable of the |
| 8 | + # same name. |
| 9 | + Annotate.set_defaults( |
| 10 | + 'routes' => 'false', |
| 11 | + 'position_in_routes' => 'before', |
| 12 | + 'position_in_class' => 'before', |
| 13 | + 'position_in_test' => 'before', |
| 14 | + 'position_in_fixture' => 'before', |
| 15 | + 'position_in_factory' => 'before', |
| 16 | + 'position_in_serializer' => 'before', |
| 17 | + 'show_foreign_keys' => 'true', |
| 18 | + 'show_complete_foreign_keys' => 'false', |
| 19 | + 'show_indexes' => 'true', |
| 20 | + 'simple_indexes' => 'false', |
| 21 | + 'model_dir' => 'app/models', |
| 22 | + 'root_dir' => '', |
| 23 | + 'include_version' => 'false', |
| 24 | + 'require' => '', |
| 25 | + 'exclude_tests' => 'false', |
| 26 | + 'exclude_fixtures' => 'false', |
| 27 | + 'exclude_factories' => 'false', |
| 28 | + 'exclude_serializers' => 'false', |
| 29 | + 'exclude_scaffolds' => 'true', |
| 30 | + 'exclude_controllers' => 'true', |
| 31 | + 'exclude_helpers' => 'true', |
| 32 | + 'exclude_sti_subclasses' => 'false', |
| 33 | + 'ignore_model_sub_dir' => 'false', |
| 34 | + 'ignore_columns' => nil, |
| 35 | + 'ignore_routes' => nil, |
| 36 | + 'ignore_unknown_models' => 'false', |
| 37 | + 'hide_limit_column_types' => 'integer,boolean', |
| 38 | + 'hide_default_column_types' => 'json,jsonb,hstore', |
| 39 | + 'skip_on_db_migrate' => 'false', |
| 40 | + 'format_bare' => 'true', |
| 41 | + 'format_rdoc' => 'false', |
| 42 | + 'format_markdown' => 'false', |
| 43 | + 'sort' => 'false', |
| 44 | + 'force' => 'false', |
| 45 | + 'classified_sort' => 'true', |
| 46 | + 'trace' => 'false', |
| 47 | + 'wrapper_open' => nil, |
| 48 | + 'wrapper_close' => nil, |
| 49 | + 'with_comment' => true |
| 50 | + ) |
| 51 | + end |
| 52 | + |
| 53 | + Annotate.load_tasks |
| 54 | +end |
0 commit comments