Upgrade Rails 5.2 -> 6.0

This commit is contained in:
Christoph Haas 2020-04-14 02:26:43 +02:00
parent d130f68172
commit 186a7d91c9
10 changed files with 106 additions and 104 deletions

View file

@ -2,7 +2,7 @@ development:
adapter: async
test:
adapter: async
adapter: test
production:
adapter: redis

View file

@ -16,6 +16,7 @@ Rails.application.configure do
# Run rails dev:cache to toggle caching.
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 = {
@ -27,7 +28,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.
@ -52,38 +53,10 @@ Rails.application.configure do
# Suppress logger output for asset requests.
config.assets.quiet = true
# Raises error for missing translations
# Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# DEB package repositories to parse when running "rake debshots:... tasks"
config.package_sources = [
{
description: 'Development test files', type: 'apt', url: 'lib/tasks/files/',
architectures: ['i386', 'amd64']
#components: ['main','restricted','universe','multiverse']
}
]
# Raises error for missing translations
# config.action_view.raise_on_missing_translations = true
# Example file for development to avoid queries to online service
# config.ubuntu_reviews_api_url = 'test/files/ubuntu-review-api/cream'
# config.ubuntu_reviews_api_url = 'https://reviews.ubuntu.com/reviews/api/1.0/reviews/filter/any/any/any/any/%s'
config.images_path = Rails.root.join('public', 'screenshots')
config.image_sizes = {
large: '800x600',
small: '160x120',
}
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker
# Any action dealing with authentication should redirect to HTTPS
#config.to_prepare { Devise::SessionsController.force_ssl(port: 3001) }
config.file_watcher = ActiveSupport::EventedFileUpdateChecker
end

View file

@ -11,6 +11,8 @@
# policy.object_src :none
# policy.script_src :self, :https
# policy.style_src :self, :https
# # If you are using webpack-dev-server then specify webpack-dev-server host
# policy.connect_src :self, :https, "http://localhost:3035", "ws://localhost:3035" if Rails.env.development?
# # Specify URI for violation reports
# # policy.report_uri "/csp-violation-report-endpoint"
@ -19,6 +21,9 @@
# If you are using UJS then enable automatic nonce generation
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) }
# Set the nonce only to specific directives
# Rails.application.config.content_security_policy_nonce_directives = %w(script-src)
# Report CSP violations to a specified URI
# For further information see the following documentation:
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only

View file

@ -4,8 +4,9 @@
# the maximum value specified for Puma. Default is set to 5 threads for minimum
# and maximum; this matches the default thread size of Active Record.
#
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count
max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
min_threads_count = ENV.fetch("RAILS_MIN_THREADS") { max_threads_count }
threads min_threads_count, max_threads_count
# Specifies the `port` that Puma will listen on to receive requests; default is 3000.
#
@ -19,7 +20,7 @@ environment ENV.fetch("RAILS_ENV") { "development" }
pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# Specifies the number of `workers` to boot in clustered mode.
# Workers are forked webserver processes. If using threads and workers together
# Workers are forked web server processes. If using threads and workers together
# the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support
# processes).

View file

@ -106,5 +106,5 @@ Rails.application.routes.draw do
# resources :products
# end
# For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
end

View file

@ -1,6 +1,6 @@
%w[
.ruby-version
.rbenv-vars
tmp/restart.txt
tmp/caching-dev.txt
].each { |path| Spring.watch(path) }
Spring.watch(
".ruby-version",
".rbenv-vars",
"tmp/restart.txt",
"tmp/caching-dev.txt"
)