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

@ -1,12 +1,13 @@
source 'https://rubygems.org' source 'https://rubygems.org'
# Bundle edge Rails instead: gem 'rails', github: 'rails/rails' # Bundle edge Rails instead: gem 'rails', github: 'rails/rails'
gem 'rails', '~> 5.2' gem 'rails', '~> 6.0'
gem 'bootsnap' gem 'bootsnap'
#gem 'webpacker'
# To create variants (different sizes) of screenshot images saved in ActiveStorage # To create variants (different sizes) of screenshot images saved in ActiveStorage
#gem 'image_processing' gem 'image_processing'
gem 'mini_magick' gem 'mini_magick'
# Use Puma as the app server # Use Puma as the app server

View file

@ -7,51 +7,64 @@ GIT
GEM GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
actioncable (5.2.4.2) actioncable (6.0.2.2)
actionpack (= 5.2.4.2) actionpack (= 6.0.2.2)
nio4r (~> 2.0) nio4r (~> 2.0)
websocket-driver (>= 0.6.1) websocket-driver (>= 0.6.1)
actionmailer (5.2.4.2) actionmailbox (6.0.2.2)
actionpack (= 5.2.4.2) actionpack (= 6.0.2.2)
actionview (= 5.2.4.2) activejob (= 6.0.2.2)
activejob (= 5.2.4.2) activerecord (= 6.0.2.2)
activestorage (= 6.0.2.2)
activesupport (= 6.0.2.2)
mail (>= 2.7.1)
actionmailer (6.0.2.2)
actionpack (= 6.0.2.2)
actionview (= 6.0.2.2)
activejob (= 6.0.2.2)
mail (~> 2.5, >= 2.5.4) mail (~> 2.5, >= 2.5.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
actionpack (5.2.4.2) actionpack (6.0.2.2)
actionview (= 5.2.4.2) actionview (= 6.0.2.2)
activesupport (= 5.2.4.2) activesupport (= 6.0.2.2)
rack (~> 2.0, >= 2.0.8) rack (~> 2.0, >= 2.0.8)
rack-test (>= 0.6.3) rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.2) rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (5.2.4.2) actiontext (6.0.2.2)
activesupport (= 5.2.4.2) actionpack (= 6.0.2.2)
activerecord (= 6.0.2.2)
activestorage (= 6.0.2.2)
activesupport (= 6.0.2.2)
nokogiri (>= 1.8.5)
actionview (6.0.2.2)
activesupport (= 6.0.2.2)
builder (~> 3.1) builder (~> 3.1)
erubi (~> 1.4) erubi (~> 1.4)
rails-dom-testing (~> 2.0) rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.0.3) rails-html-sanitizer (~> 1.1, >= 1.2.0)
activejob (5.2.4.2) activejob (6.0.2.2)
activesupport (= 5.2.4.2) activesupport (= 6.0.2.2)
globalid (>= 0.3.6) globalid (>= 0.3.6)
activemodel (5.2.4.2) activemodel (6.0.2.2)
activesupport (= 5.2.4.2) activesupport (= 6.0.2.2)
activerecord (5.2.4.2) activerecord (6.0.2.2)
activemodel (= 5.2.4.2) activemodel (= 6.0.2.2)
activesupport (= 5.2.4.2) activesupport (= 6.0.2.2)
arel (>= 9.0) activestorage (6.0.2.2)
activestorage (5.2.4.2) actionpack (= 6.0.2.2)
actionpack (= 5.2.4.2) activejob (= 6.0.2.2)
activerecord (= 5.2.4.2) activerecord (= 6.0.2.2)
marcel (~> 0.3.1) marcel (~> 0.3.1)
activesupport (5.2.4.2) activesupport (6.0.2.2)
concurrent-ruby (~> 1.0, >= 1.0.2) concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 0.7, < 2) i18n (>= 0.7, < 2)
minitest (~> 5.1) minitest (~> 5.1)
tzinfo (~> 1.1) tzinfo (~> 1.1)
zeitwerk (~> 2.2)
addressable (2.7.0) addressable (2.7.0)
public_suffix (>= 2.0.2, < 5.0) public_suffix (>= 2.0.2, < 5.0)
ansi (1.5.0) ansi (1.5.0)
arel (9.0.0)
babel-source (5.8.35) babel-source (5.8.35)
babel-transpiler (0.7.0) babel-transpiler (0.7.0)
babel-source (>= 4.0, < 6) babel-source (>= 4.0, < 6)
@ -132,6 +145,9 @@ GEM
hashie (4.1.0) hashie (4.1.0)
i18n (1.8.2) i18n (1.8.2)
concurrent-ruby (~> 1.0) concurrent-ruby (~> 1.0)
image_processing (1.10.3)
mini_magick (>= 4.9.5, < 5)
ruby-vips (>= 2.0.17, < 3)
jbuilder (2.10.0) jbuilder (2.10.0)
activesupport (>= 5.0.0) activesupport (>= 5.0.0)
jquery-rails (4.3.5) jquery-rails (4.3.5)
@ -166,9 +182,9 @@ GEM
mini_mime (1.0.2) mini_mime (1.0.2)
mini_portile2 (2.4.0) mini_portile2 (2.4.0)
minitest (5.14.0) minitest (5.14.0)
minitest-rails (5.2.0) minitest-rails (6.0.1)
minitest (~> 5.10) minitest (~> 5.10)
railties (~> 5.2.0) railties (~> 6.0.0)
minitest-rails-capybara (0.0.2) minitest-rails-capybara (0.0.2)
capybara capybara
minitest-rails minitest-rails
@ -237,18 +253,20 @@ GEM
ruby-openid (>= 2.1.8) ruby-openid (>= 2.1.8)
rack-test (1.1.0) rack-test (1.1.0)
rack (>= 1.0, < 3) rack (>= 1.0, < 3)
rails (5.2.4.2) rails (6.0.2.2)
actioncable (= 5.2.4.2) actioncable (= 6.0.2.2)
actionmailer (= 5.2.4.2) actionmailbox (= 6.0.2.2)
actionpack (= 5.2.4.2) actionmailer (= 6.0.2.2)
actionview (= 5.2.4.2) actionpack (= 6.0.2.2)
activejob (= 5.2.4.2) actiontext (= 6.0.2.2)
activemodel (= 5.2.4.2) actionview (= 6.0.2.2)
activerecord (= 5.2.4.2) activejob (= 6.0.2.2)
activestorage (= 5.2.4.2) activemodel (= 6.0.2.2)
activesupport (= 5.2.4.2) activerecord (= 6.0.2.2)
activestorage (= 6.0.2.2)
activesupport (= 6.0.2.2)
bundler (>= 1.3.0) bundler (>= 1.3.0)
railties (= 5.2.4.2) railties (= 6.0.2.2)
sprockets-rails (>= 2.0.0) sprockets-rails (>= 2.0.0)
rails-dom-testing (2.0.3) rails-dom-testing (2.0.3)
activesupport (>= 4.2.0) activesupport (>= 4.2.0)
@ -260,12 +278,12 @@ GEM
ruby-graphviz (~> 1.2) ruby-graphviz (~> 1.2)
rails-html-sanitizer (1.3.0) rails-html-sanitizer (1.3.0)
loofah (~> 2.3) loofah (~> 2.3)
railties (5.2.4.2) railties (6.0.2.2)
actionpack (= 5.2.4.2) actionpack (= 6.0.2.2)
activesupport (= 5.2.4.2) activesupport (= 6.0.2.2)
method_source method_source
rake (>= 0.8.7) rake (>= 0.8.7)
thor (>= 0.19.0, < 2.0) thor (>= 0.20.3, < 2.0)
rake (13.0.1) rake (13.0.1)
rb-fsevent (0.10.3) rb-fsevent (0.10.3)
rb-inotify (0.10.1) rb-inotify (0.10.1)
@ -281,6 +299,8 @@ GEM
rexml rexml
ruby-openid (2.9.2) ruby-openid (2.9.2)
ruby-progressbar (1.10.1) ruby-progressbar (1.10.1)
ruby-vips (2.0.17)
ffi (~> 1.9)
sass (3.7.4) sass (3.7.4)
sass-listen (~> 4.0.0) sass-listen (~> 4.0.0)
sass-listen (4.0.0) sass-listen (4.0.0)
@ -336,11 +356,11 @@ GEM
execjs (>= 0.3.0, < 3) execjs (>= 0.3.0, < 3)
warden (1.2.8) warden (1.2.8)
rack (>= 2.0.6) rack (>= 2.0.6)
web-console (3.7.0) web-console (4.0.1)
actionview (>= 5.0) actionview (>= 6.0.0)
activemodel (>= 5.0) activemodel (>= 6.0.0)
bindex (>= 0.4.0) bindex (>= 0.4.0)
railties (>= 5.0) railties (>= 6.0.0)
websocket-driver (0.7.1) websocket-driver (0.7.1)
websocket-extensions (>= 0.1.0) websocket-extensions (>= 0.1.0)
websocket-extensions (0.1.4) websocket-extensions (0.1.4)
@ -349,6 +369,7 @@ GEM
will_paginate (>= 3.0.3) will_paginate (>= 3.0.3)
xpath (3.2.0) xpath (3.2.0)
nokogiri (~> 1.8) nokogiri (~> 1.8)
zeitwerk (2.3.0)
PLATFORMS PLATFORMS
ruby ruby
@ -367,6 +388,7 @@ DEPENDENCIES
foundation-rails (~> 6.4) foundation-rails (~> 6.4)
guard-minitest guard-minitest
guard-rails guard-rails
image_processing
jbuilder (~> 2.5) jbuilder (~> 2.5)
jquery-rails jquery-rails
listen (~> 3.0.5) listen (~> 3.0.5)
@ -384,7 +406,7 @@ DEPENDENCIES
pg pg
pg_search pg_search
puma (~> 3.0) puma (~> 3.0)
rails (~> 5.2) rails (~> 6.0)
rails-erd rails-erd
sass-rails (~> 5.0) sass-rails (~> 5.0)
sdoc (~> 0.4.0) sdoc (~> 0.4.0)

View file

@ -1,6 +1,5 @@
#!/usr/bin/env ruby #!/usr/bin/env ruby
require 'fileutils' require 'fileutils'
include FileUtils
# path to your application root. # path to your application root.
APP_ROOT = File.expand_path('..', __dir__) APP_ROOT = File.expand_path('..', __dir__)
@ -9,24 +8,25 @@ def system!(*args)
system(*args) || abort("\n== Command #{args} failed ==") system(*args) || abort("\n== Command #{args} failed ==")
end end
chdir APP_ROOT do FileUtils.chdir APP_ROOT do
# This script is a starting point to setup your application. # This script is a way to setup or update your development environment automatically.
# This script is idempotent, so that you can run it at anytime and get an expectable outcome.
# Add necessary setup steps to this file. # Add necessary setup steps to this file.
puts '== Installing dependencies ==' puts '== Installing dependencies =='
system! 'gem install bundler --conservative' system! 'gem install bundler --conservative'
system('bundle check') || system!('bundle install') system('bundle check') || system!('bundle install')
# Install JavaScript dependencies if using Yarn # Install JavaScript dependencies
# system('bin/yarn') # system('bin/yarn')
# puts "\n== Copying sample files ==" # puts "\n== Copying sample files =="
# unless File.exist?('config/database.yml') # unless File.exist?('config/database.yml')
# cp 'config/database.yml.sample', 'config/database.yml' # FileUtils.cp 'config/database.yml.sample', 'config/database.yml'
# end # end
puts "\n== Preparing database ==" puts "\n== Preparing database =="
system! 'bin/rails db:setup' system! 'bin/rails db:prepare'
puts "\n== Removing old logs and tempfiles ==" puts "\n== Removing old logs and tempfiles =="
system! 'bin/rails log:clear tmp:clear' system! 'bin/rails log:clear tmp:clear'

View file

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

View file

@ -16,6 +16,7 @@ Rails.application.configure do
# Run rails dev:cache to toggle caching. # 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.perform_caching = true
config.action_controller.enable_fragment_cache_logging = true
config.cache_store = :memory_store config.cache_store = :memory_store
config.public_file_server.headers = { config.public_file_server.headers = {
@ -27,7 +28,7 @@ Rails.application.configure do
config.cache_store = :null_store config.cache_store = :null_store
end 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 config.active_storage.service = :local
# Don't care if the mailer can't send. # Don't care if the mailer can't send.
@ -52,38 +53,10 @@ Rails.application.configure do
# Suppress logger output for asset requests. # Suppress logger output for asset requests.
config.assets.quiet = true config.assets.quiet = true
# Raises error for missing translations # Raises error for missing translations.
# config.action_view.raise_on_missing_translations = true # config.action_view.raise_on_missing_translations = true
# Use an evented file watcher to asynchronously detect changes in source code, # Use an evented file watcher to asynchronously detect changes in source code,
# routes, locales, etc. This feature depends on the listen gem. # routes, locales, etc. This feature depends on the listen gem.
# config.file_watcher = ActiveSupport::EventedFileUpdateChecker 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) }
end end

View file

@ -11,6 +11,8 @@
# policy.object_src :none # policy.object_src :none
# policy.script_src :self, :https # policy.script_src :self, :https
# policy.style_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 # # Specify URI for violation reports
# # policy.report_uri "/csp-violation-report-endpoint" # # policy.report_uri "/csp-violation-report-endpoint"
@ -19,6 +21,9 @@
# If you are using UJS then enable automatic nonce generation # If you are using UJS then enable automatic nonce generation
# Rails.application.config.content_security_policy_nonce_generator = -> request { SecureRandom.base64(16) } # 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 # Report CSP violations to a specified URI
# For further information see the following documentation: # For further information see the following documentation:
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy-Report-Only # 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 # 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. # and maximum; this matches the default thread size of Active Record.
# #
threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 } max_threads_count = ENV.fetch("RAILS_MAX_THREADS") { 5 }
threads threads_count, threads_count 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. # 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" } pidfile ENV.fetch("PIDFILE") { "tmp/pids/server.pid" }
# Specifies the number of `workers` to boot in clustered mode. # 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`. # the concurrency of the application would be max `threads` * `workers`.
# Workers do not work on JRuby or Windows (both of which do not support # Workers do not work on JRuby or Windows (both of which do not support
# processes). # processes).

View file

@ -106,5 +106,5 @@ Rails.application.routes.draw do
# resources :products # resources :products
# end # 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 end

View file

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

View file

@ -2,15 +2,15 @@
# of editing this file, please use the migrations feature of Active Record to # of editing this file, please use the migrations feature of Active Record to
# incrementally modify your database, and then regenerate this schema definition. # incrementally modify your database, and then regenerate this schema definition.
# #
# Note that this schema.rb definition is the authoritative source for your # This file is the source Rails uses to define your schema when running `rails
# database schema. If you need to create the application database on another # db:schema:load`. When creating a new database, `rails db:schema:load` tends to
# system, you should be using db:schema:load, not running all the migrations # be faster and is potentially less error prone than running all of your
# from scratch. The latter is a flawed and unsustainable approach (the more migrations # migrations from scratch. Old migrations may fail to apply correctly if those
# you'll amass, the slower it'll run and the greater likelihood for issues). # migrations use external dependencies or application code.
# #
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 2020_04_13_210200) do ActiveRecord::Schema.define(version: 2020_04_14_002409) do
# These are extensions that must be enabled in order to support this database # These are extensions that must be enabled in order to support this database
enable_extension "plpgsql" enable_extension "plpgsql"