update config.

This commit is contained in:
snogrammer 2021-06-12 17:38:00 -06:00
parent 27e954adc2
commit 81a13d208f
4 changed files with 25 additions and 17 deletions

15
config/app.yml Normal file
View File

@ -0,0 +1,15 @@
default: &default
short_name: '# TODO: Change in config/app.yml'
title: '# TODO: Change in config/app.yml'
development:
<<: *default
test:
<<: *default
staging:
<<: *default
production:
<<: *default

View File

@ -22,8 +22,9 @@ require 'sprockets/railtie'
Bundler.require(*Rails.groups)
module App
SHORT_NAME = 'app' # TODO: Update name
TITLE = 'TODO: Update in config/application.rb'
CONFIG = Application.configuration.x.app = config_for(:app)
SHORT_NAME = CONFIG.short_name
TITLE = CONFIG.title
class Application < Rails::Application
config.x.redis = config_for(:redis)

View File

@ -42,6 +42,8 @@ Rails.application.configure do
# Print deprecation notices to the stderr.
config.active_support.deprecation = :stderr
config.log_level = :warn
# Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true
end

View File

@ -10,20 +10,8 @@ cd "$(dirname "$0")/.."
export PROJECT_NAME="app_test" RAILS_ENV="test" RACK_ENV="test"
# setup test database
printf "\n===> Migrating $RAILS_ENV database ...\n"
printf "\n*************************************************************"
printf "\n********************** MIGRATION NOTE ***********************"
printf "\n** Script assumes database is already created **"
printf "\n** **"
printf "\n** Run the following command if error encountered **"
printf "\n** **"
printf "\n** docker-compose run -e RAILS_ENV=$RAILS_ENV app rake db:create **"
printf "\n** **"
printf "\n*************************************************************"
printf "\n*************************************************************\n"
docker-compose run -e RAILS_ENV=$RAILS_ENV app rails db:environment:set
printf "\n===> Migrating database ...\n";
docker-compose run -e RAILS_ENV=$RAILS_ENV app rails db:create db:schema:load db:migrate
printf "\n===> Running tests ...\n";
@ -33,4 +21,6 @@ else
docker-compose run -e RAILS_ENV=$RAILS_ENV app rspec
fi
docker-compose down
printf "\n===> Removing app instances ...\n";
docker-compose stop
docker rm $(docker ps -a -q --filter="name=*_app_run*")