mirror of
https://github.com/Evolix/chexpire.git
synced 2024-04-28 15:00:50 +02:00
Setup models & routes annotations
This commit is contained in:
parent
8c6a8354a3
commit
96e5b91835
4
Gemfile
4
Gemfile
|
@ -46,8 +46,10 @@ group :development do
|
|||
gem 'spring'
|
||||
gem 'spring-watcher-listen', '~> 2.0.0'
|
||||
|
||||
gem 'capistrano-rails'
|
||||
gem 'rubocop', '~> 0.56.0', require: false
|
||||
gem 'annotate', require: false
|
||||
|
||||
gem 'capistrano-rails'
|
||||
gem "capistrano", "~> 3.10", require: false
|
||||
gem "capistrano-rbenv", require: false
|
||||
gem 'capistrano3-puma', require: false
|
||||
|
|
|
@ -46,6 +46,9 @@ GEM
|
|||
public_suffix (>= 2.0.2, < 4.0)
|
||||
airbrussh (1.3.0)
|
||||
sshkit (>= 1.6.1, != 1.7.0)
|
||||
annotate (2.7.3)
|
||||
activerecord (>= 3.2, < 6.0)
|
||||
rake (>= 10.4, < 13.0)
|
||||
archive-zip (0.11.0)
|
||||
io-like (~> 0.3.0)
|
||||
arel (9.0.0)
|
||||
|
@ -236,6 +239,7 @@ PLATFORMS
|
|||
ruby
|
||||
|
||||
DEPENDENCIES
|
||||
annotate
|
||||
bcrypt (~> 3.1.7)
|
||||
bootsnap (>= 1.1.0)
|
||||
byebug
|
||||
|
|
|
@ -1,3 +1,15 @@
|
|||
# == Route Map
|
||||
#
|
||||
# Prefix Verb URI Pattern Controller#Action
|
||||
# root GET / pages#home
|
||||
# rails_service_blob GET /rails/active_storage/blobs/:signed_id/*filename(.:format) active_storage/blobs#show
|
||||
# rails_blob_representation GET /rails/active_storage/representations/:signed_blob_id/:variation_key/*filename(.:format) active_storage/representations#show
|
||||
# rails_disk_service GET /rails/active_storage/disk/:encoded_key/*filename(.:format) active_storage/disk#show
|
||||
# update_rails_disk_service PUT /rails/active_storage/disk/:encoded_token(.:format) active_storage/disk#update
|
||||
# rails_direct_uploads POST /rails/active_storage/direct_uploads(.:format) active_storage/direct_uploads#create
|
||||
|
||||
# In order to update the route map above,
|
||||
# run `bundle exec annotate -r` after modifying this file
|
||||
Rails.application.routes.draw do
|
||||
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
|
||||
root to: "pages#home"
|
||||
|
|
54
lib/tasks/auto_annotate_models.rake
Normal file
54
lib/tasks/auto_annotate_models.rake
Normal file
|
@ -0,0 +1,54 @@
|
|||
# NOTE: only doing this in development as some production environments (Heroku)
|
||||
# NOTE: are sensitive to local FS writes, and besides -- it's just not proper
|
||||
# NOTE: to have a dev-mode tool do its thing in production.
|
||||
if Rails.env.development?
|
||||
require 'annotate'
|
||||
task :set_annotation_options do
|
||||
# You can override any of these by setting an environment variable of the
|
||||
# same name.
|
||||
Annotate.set_defaults(
|
||||
'routes' => 'before',
|
||||
'position_in_routes' => 'before',
|
||||
'position_in_class' => 'before',
|
||||
'position_in_test' => 'before',
|
||||
'position_in_fixture' => 'before',
|
||||
'position_in_factory' => 'before',
|
||||
'position_in_serializer' => 'before',
|
||||
'show_foreign_keys' => 'true',
|
||||
'show_complete_foreign_keys' => 'false',
|
||||
'show_indexes' => 'true',
|
||||
'simple_indexes' => 'false',
|
||||
'model_dir' => 'app/models',
|
||||
'root_dir' => '',
|
||||
'include_version' => 'false',
|
||||
'require' => '',
|
||||
'exclude_tests' => 'false',
|
||||
'exclude_fixtures' => 'false',
|
||||
'exclude_factories' => 'false',
|
||||
'exclude_serializers' => 'false',
|
||||
'exclude_scaffolds' => 'true',
|
||||
'exclude_controllers' => 'true',
|
||||
'exclude_helpers' => 'true',
|
||||
'exclude_sti_subclasses' => 'false',
|
||||
'ignore_model_sub_dir' => 'false',
|
||||
'ignore_columns' => nil,
|
||||
'ignore_routes' => nil,
|
||||
'ignore_unknown_models' => 'false',
|
||||
'hide_limit_column_types' => 'integer,boolean',
|
||||
'hide_default_column_types' => 'json,jsonb,hstore',
|
||||
'skip_on_db_migrate' => 'false',
|
||||
'format_bare' => 'true',
|
||||
'format_rdoc' => 'false',
|
||||
'format_markdown' => 'false',
|
||||
'sort' => 'false',
|
||||
'force' => 'false',
|
||||
'classified_sort' => 'true',
|
||||
'trace' => 'false',
|
||||
'wrapper_open' => nil,
|
||||
'wrapper_close' => nil,
|
||||
'with_comment' => true
|
||||
)
|
||||
end
|
||||
|
||||
Annotate.load_tasks
|
||||
end
|
Loading…
Reference in a new issue