Upgrade to Rails 6.0 and apply new framework defaults

This commit is contained in:
Sebastian Serth
2021-05-10 22:04:49 +02:00
parent 3c4ff307af
commit 8378070bc2
25 changed files with 232 additions and 171 deletions

View File

@ -1,8 +1,6 @@
# frozen_string_literal: true
Rails.application.configure do
# Verifies that versions and hashed value of the package contents in the project's package.json
config.webpacker.check_yarn_integrity = true
# Settings specified here will take precedence over those in config/application.rb.
config.web_console.whitelisted_ips = '192.168.0.0/16'
@ -20,8 +18,9 @@ Rails.application.configure do
# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp/caching-dev.txt').exist?
if Rails.root.join('tmp', 'caching-dev.txt').exist?
config.action_controller.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
config.cache_store = :memory_store
config.public_file_server.headers = {
@ -33,7 +32,7 @@ Rails.application.configure do
config.cache_store = :null_store
end
# Store uploaded files on the local file system (see config/storage.yml for options)
# Store uploaded files on the local file system (see config/storage.yml for options).
config.active_storage.service = :local
# Don't care if the mailer can't send.
@ -55,26 +54,22 @@ Rails.application.configure do
# number of complex assets.
config.assets.debug = true
# Asset digests allow you to set far-future HTTP expiration dates on all assets,
# yet still be able to expire them through the digest params.
config.assets.digest = true
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
# Adds additional error checking when serving assets at runtime.
# Checks for improperly declared sprockets dependencies.
# Raises helpful error messages.
config.assets.raise_runtime_errors = true
# Raises error for missing translations
config.action_view.raise_on_missing_translations = true
BetterErrors::Middleware.allow_ip! ENV['TRUSTED_IP'] if ENV['TRUSTED_IP']
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem and might not
# work within a Vagrant environment.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
config.file_watcher = ActiveSupport::FileUpdateChecker
# routes, locales, etc. This feature depends on the listen gem.
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# If the evented file watcher doesn't work (in Vagrant), use another one:
# config.file_watcher = ActiveSupport::FileUpdateChecker
end