From e540504262fd7bdc85b9e76b76de168b148db1bb Mon Sep 17 00:00:00 2001 From: Benjamin FAURE Date: Mon, 9 May 2022 14:31:00 +0200 Subject: [PATCH] Updated Rails to V6 & various code fixes following update --- Gemfile | 2 +- Gemfile.lock | 173 ++++++++++-------- .../org_admin/templates_controller.rb | 1 + app/controllers/plans_controller.rb | 2 +- bin/rails | 1 + bin/rake | 1 + bin/setup | 2 +- config/environments/development.rb | 19 +- config/environments/production.rb | 30 ++- config/environments/test.rb | 15 +- config/initializers/backtrace_silencers.rb | 2 +- .../initializers/filter_parameter_logging.rb | 3 + .../new_framework_defaults_6_1.rb | 67 +++++++ config/initializers/permissions_policy.rb | 11 ++ config/spring.rb | 12 +- 15 files changed, 249 insertions(+), 92 deletions(-) create mode 100644 config/initializers/new_framework_defaults_6_1.rb create mode 100644 config/initializers/permissions_policy.rb diff --git a/Gemfile b/Gemfile index d25c86bd0c..047b4682df 100644 --- a/Gemfile +++ b/Gemfile @@ -9,7 +9,7 @@ ruby '>= 2.6.3' # ===========# # Full-stack web application framework. (http://rubyonrails.org) -gem 'rails', '~> 5.2' +gem 'rails', '~> 6.1' # TODO: Remove this once Rails addresses the issue with its dependency on mimemagic. Mimemagic had # an MIT license but was using some incompatible GPL license code. diff --git a/Gemfile.lock b/Gemfile.lock index 88aba7124d..aa720acc9c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,50 +1,68 @@ GEM remote: https://rubygems.org/ specs: - actioncable (5.2.7) - actionpack (= 5.2.7) + actioncable (6.1.5.1) + actionpack (= 6.1.5.1) + activesupport (= 6.1.5.1) nio4r (~> 2.0) websocket-driver (>= 0.6.1) - actionmailer (5.2.7) - actionpack (= 5.2.7) - actionview (= 5.2.7) - activejob (= 5.2.7) + actionmailbox (6.1.5.1) + actionpack (= 6.1.5.1) + activejob (= 6.1.5.1) + activerecord (= 6.1.5.1) + activestorage (= 6.1.5.1) + activesupport (= 6.1.5.1) + mail (>= 2.7.1) + actionmailer (6.1.5.1) + actionpack (= 6.1.5.1) + actionview (= 6.1.5.1) + activejob (= 6.1.5.1) + activesupport (= 6.1.5.1) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.2.7) - actionview (= 5.2.7) - activesupport (= 5.2.7) - rack (~> 2.0, >= 2.0.8) + actionpack (6.1.5.1) + actionview (= 6.1.5.1) + activesupport (= 6.1.5.1) + rack (~> 2.0, >= 2.0.9) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.2.7) - activesupport (= 5.2.7) + rails-html-sanitizer (~> 1.0, >= 1.2.0) + actiontext (6.1.5.1) + actionpack (= 6.1.5.1) + activerecord (= 6.1.5.1) + activestorage (= 6.1.5.1) + activesupport (= 6.1.5.1) + nokogiri (>= 1.8.5) + actionview (6.1.5.1) + activesupport (= 6.1.5.1) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) - rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.2.7) - activesupport (= 5.2.7) + rails-html-sanitizer (~> 1.1, >= 1.2.0) + activejob (6.1.5.1) + activesupport (= 6.1.5.1) globalid (>= 0.3.6) - activemodel (5.2.7) - activesupport (= 5.2.7) - activerecord (5.2.7) - activemodel (= 5.2.7) - activesupport (= 5.2.7) - arel (>= 9.0) + activemodel (6.1.5.1) + activesupport (= 6.1.5.1) + activerecord (6.1.5.1) + activemodel (= 6.1.5.1) + activesupport (= 6.1.5.1) activerecord_json_validator (2.1.0) activerecord (>= 4.2.0, < 8) json_schemer (~> 0.2.18) - activestorage (5.2.7) - actionpack (= 5.2.7) - activerecord (= 5.2.7) - marcel (~> 1.0.0) - activesupport (5.2.7) + activestorage (6.1.5.1) + actionpack (= 6.1.5.1) + activejob (= 6.1.5.1) + activerecord (= 6.1.5.1) + activesupport (= 6.1.5.1) + marcel (~> 1.0) + mini_mime (>= 1.1.0) + activesupport (6.1.5.1) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (>= 0.7, < 2) - minitest (~> 5.1) - tzinfo (~> 1.1) + i18n (>= 1.6, < 2) + minitest (>= 5.1) + tzinfo (~> 2.0) + zeitwerk (~> 2.3) addressable (2.8.0) public_suffix (>= 2.0.2, < 5.0) annotate (3.2.0) @@ -53,9 +71,8 @@ GEM annotate_gem (0.0.14) bundler (>= 1.1) api-pagination (4.8.2) - arel (9.0.0) ast (2.4.2) - autoprefixer-rails (10.4.2.0) + autoprefixer-rails (10.4.7.0) execjs (~> 2) bcrypt (3.1.17) better_errors (2.9.1) @@ -67,7 +84,7 @@ GEM debug_inspector (>= 0.0.1) bootsnap (1.11.1) msgpack (~> 1.2) - brakeman (5.2.1) + brakeman (5.2.3) builder (3.2.4) bullet (7.0.1) activesupport (>= 3.0.0) @@ -136,7 +153,7 @@ GEM ecma-re-validator (0.4.0) regexp_parser (~> 2.2) erubi (1.10.0) - excon (0.92.2) + excon (0.92.3) execjs (2.8.1) factory_bot (6.2.1) activesupport (>= 5.0.0) @@ -148,7 +165,7 @@ GEM faraday (2.2.0) faraday-net_http (~> 2.0) ruby2_keywords (>= 0.0.4) - faraday-net_http (2.0.1) + faraday-net_http (2.0.2) ffi (1.15.5) flag_shih_tzu (0.3.23) fog-aws (3.13.0) @@ -210,7 +227,7 @@ GEM actionview (>= 5.0.0) activesupport (>= 5.0.0) json (2.6.1) - json_schemer (0.2.20) + json_schemer (0.2.21) ecma-re-validator (~> 0.3) hana (~> 1.3) regexp_parser (~> 2.0) @@ -236,7 +253,7 @@ GEM rb-fsevent (~> 0.10, >= 0.10.3) rb-inotify (~> 0.9, >= 0.9.10) locale (2.1.3) - loofah (2.16.0) + loofah (2.17.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) lumberjack (1.2.8) @@ -254,14 +271,14 @@ GEM mini_mime (1.1.2) mini_portile2 (2.8.0) minitest (5.15.0) - mocha (1.13.0) - msgpack (1.5.0) + mocha (1.14.0) + msgpack (1.5.1) multi_json (1.15.0) multi_xml (0.6.0) - mysql2 (0.5.3) + mysql2 (0.5.4) nenv (0.3.0) nio4r (2.5.8) - nokogiri (1.13.3) + nokogiri (1.13.5) mini_portile2 (~> 2.8.0) racc (~> 1.4) notiffany (0.1.3) @@ -273,9 +290,9 @@ GEM multi_json (~> 1.3) multi_xml (~> 0.5) rack (>= 1.2, < 3) - omniauth (2.0.4) + omniauth (2.1.0) hashie (>= 3.4.6) - rack (>= 1.6.2, < 3) + rack (>= 2.2.3) rack-protection omniauth-oauth2 (1.7.2) oauth2 (~> 1.4) @@ -291,7 +308,7 @@ GEM options (2.3.2) orm_adapter (0.5.0) parallel (1.22.1) - parser (3.1.1.0) + parser (3.1.2.0) ast (~> 2.4.1) pg (1.3.5) prime (0.1.2) @@ -303,7 +320,7 @@ GEM pry (0.14.1) coderay (~> 1.1) method_source (~> 1.0) - public_suffix (4.0.6) + public_suffix (4.0.7) puma (5.6.4) nio4r (~> 2.0) pundit (2.2.0) @@ -320,18 +337,20 @@ GEM rack rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.2.7) - actioncable (= 5.2.7) - actionmailer (= 5.2.7) - actionpack (= 5.2.7) - actionview (= 5.2.7) - activejob (= 5.2.7) - activemodel (= 5.2.7) - activerecord (= 5.2.7) - activestorage (= 5.2.7) - activesupport (= 5.2.7) - bundler (>= 1.3.0) - railties (= 5.2.7) + rails (6.1.5.1) + actioncable (= 6.1.5.1) + actionmailbox (= 6.1.5.1) + actionmailer (= 6.1.5.1) + actionpack (= 6.1.5.1) + actiontext (= 6.1.5.1) + actionview (= 6.1.5.1) + activejob (= 6.1.5.1) + activemodel (= 6.1.5.1) + activerecord (= 6.1.5.1) + activestorage (= 6.1.5.1) + activesupport (= 6.1.5.1) + bundler (>= 1.15.0) + railties (= 6.1.5.1) sprockets-rails (>= 2.0.0) rails-controller-testing (1.0.5) actionpack (>= 5.0.1.rc1) @@ -342,12 +361,12 @@ GEM nokogiri (>= 1.6) rails-html-sanitizer (1.4.2) loofah (~> 2.3) - railties (5.2.7) - actionpack (= 5.2.7) - activesupport (= 5.2.7) + railties (6.1.5.1) + actionpack (= 6.1.5.1) + activesupport (= 6.1.5.1) method_source - rake (>= 0.8.7) - thor (>= 0.19.0, < 2.0) + rake (>= 12.2) + thor (~> 1.0) rainbow (3.1.1) rake (13.0.6) rb-fsevent (0.11.1) @@ -355,7 +374,7 @@ GEM ffi (~> 1.0) recaptcha (5.9.0) json - regexp_parser (2.2.1) + regexp_parser (2.3.1) responders (3.0.1) actionpack (>= 5.0) railties (>= 5.0) @@ -375,7 +394,7 @@ GEM rspec-mocks (3.11.1) diff-lcs (>= 1.2.0, < 2.0) rspec-support (~> 3.11.0) - rspec-rails (5.1.1) + rspec-rails (5.1.2) actionpack (>= 5.2) activesupport (>= 5.2) railties (>= 5.2) @@ -384,16 +403,16 @@ GEM rspec-mocks (~> 3.10) rspec-support (~> 3.10) rspec-support (3.11.0) - rubocop (1.26.1) + rubocop (1.28.2) parallel (~> 1.10) parser (>= 3.1.0.0) rainbow (>= 2.2.2, < 4.0) regexp_parser (>= 1.8, < 3.0) rexml - rubocop-ast (>= 1.16.0, < 2.0) + rubocop-ast (>= 1.17.0, < 2.0) ruby-progressbar (~> 1.7) unicode-display_width (>= 1.4.0, < 3.0) - rubocop-ast (1.16.0) + rubocop-ast (1.17.0) parser (>= 3.1.1.0) rubocop-i18n (3.0.0) rubocop (~> 1.0) @@ -406,7 +425,7 @@ GEM rubocop (>= 1.7.0, < 2.0) rubocop-rake (0.6.0) rubocop (~> 1.0) - rubocop-rspec (2.9.0) + rubocop-rspec (2.10.0) rubocop (~> 1.19) rubocop-thread_safety (0.4.4) rubocop (>= 0.53.0) @@ -451,7 +470,6 @@ GEM sprockets (>= 3.0.0) text (1.3.1) thor (1.2.1) - thread_safe (0.3.6) tilt (2.0.10) tomparse (0.4.2) translation (1.31) @@ -459,18 +477,18 @@ GEM turbolinks (5.2.1) turbolinks-source (~> 5.2) turbolinks-source (5.2.0) - tzinfo (1.2.9) - thread_safe (~> 0.1) + tzinfo (2.0.4) + concurrent-ruby (~> 1.0) unicode-display_width (2.1.0) uniform_notifier (1.16.0) uri_template (0.7.0) warden (1.2.9) rack (>= 2.0.9) - web-console (3.7.0) - actionview (>= 5.0) - activemodel (>= 5.0) + web-console (4.2.0) + actionview (>= 6.0.0) + activemodel (>= 6.0.0) bindex (>= 0.4.0) - railties (>= 5.0) + railties (>= 6.0.0) webdrivers (4.7.0) nokogiri (~> 1.6) rubyzip (>= 1.3.0) @@ -488,7 +506,7 @@ GEM websocket-driver (0.7.5) websocket-extensions (>= 0.1.0) websocket-extensions (0.1.5) - wicked_pdf (2.1.0) + wicked_pdf (2.6.2) activesupport wkhtmltopdf-binary (0.12.6.5) xpath (3.2.0) @@ -499,6 +517,7 @@ GEM tomparse (>= 0.4.0) yard zaru (0.3.0) + zeitwerk (2.5.4) PLATFORMS ruby @@ -554,7 +573,7 @@ DEPENDENCIES pundit pundit-matchers rack-mini-profiler - rails (~> 5.2) + rails (~> 6.1) rails-controller-testing recaptcha rollbar diff --git a/app/controllers/org_admin/templates_controller.rb b/app/controllers/org_admin/templates_controller.rb index 537ea4c5e4..88f9ede0fe 100644 --- a/app/controllers/org_admin/templates_controller.rb +++ b/app/controllers/org_admin/templates_controller.rb @@ -136,6 +136,7 @@ def edit 'question_options.number') .select('phases.title', 'phases.description', + 'phases.modifiable', 'sections.title', 'questions.text', 'question_options.text') diff --git a/app/controllers/plans_controller.rb b/app/controllers/plans_controller.rb index 404a6a782f..7ddefde3fb 100644 --- a/app/controllers/plans_controller.rb +++ b/app/controllers/plans_controller.rb @@ -163,7 +163,7 @@ def create def show @plan = Plan.includes( template: { phases: { sections: { questions: :answers } } }, - plans_guidance_groups: { guidance_group: :guidances } + guidance_groups: :guidances ).find(params[:id]) authorize @plan diff --git a/bin/rails b/bin/rails index 0739660237..40b071ea57 100755 --- a/bin/rails +++ b/bin/rails @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +load File.expand_path("spring", __dir__) APP_PATH = File.expand_path('../config/application', __dir__) require_relative '../config/boot' require 'rails/commands' diff --git a/bin/rake b/bin/rake index 17240489f6..a5c86fcf1f 100755 --- a/bin/rake +++ b/bin/rake @@ -1,4 +1,5 @@ #!/usr/bin/env ruby +load File.expand_path("spring", __dir__) require_relative '../config/boot' require 'rake' Rake.application.run diff --git a/bin/setup b/bin/setup index 2b9a6e8d48..d49acbfd70 100755 --- a/bin/setup +++ b/bin/setup @@ -27,7 +27,7 @@ chdir APP_ROOT do end puts "\n== Preparing database ==" - system! 'bin/rails db:setup' + system! 'bin/rails db:prepare' puts "\n== Fetching mime types and adding to database ==" system! 'bin/rails mime_types:load' diff --git a/config/environments/development.rb b/config/environments/development.rb index 6180a5db75..451d21e7b1 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -1,4 +1,6 @@ # frozen_string_literal: true +require 'active_support/core_ext/integer/time' + Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -18,6 +20,7 @@ # 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 = { @@ -48,6 +51,12 @@ # when problems arise. config.log_level = ENV['RAILS_LOG_LEVEL']&.to_sym || :debug + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Raise an error on page load if there are pending migrations. config.active_record.migration_error = :page_load @@ -62,12 +71,18 @@ # Suppress logger output for asset requests. config.assets.quiet = true - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = 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 + + # Uncomment if you wish to allow Action Cable access from any origin. + # config.action_cable.disable_request_forgery_protection = true end # Used by Rails' routes url_helpers (typically when including a link in an email) diff --git a/config/environments/production.rb b/config/environments/production.rb index 91c4b08438..531b152317 100644 --- a/config/environments/production.rb +++ b/config/environments/production.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +require 'active_support/core_ext/integer/time' Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -78,6 +79,12 @@ # Send deprecation notices to registered listeners. config.active_support.deprecation = :notify + # Log disallowed deprecations. + config.active_support.disallowed_deprecation = :log + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + # Use default logging formatter so that PID and timestamp are not suppressed. config.log_formatter = ::Logger::Formatter.new @@ -86,13 +93,34 @@ # config.logger = ActiveSupport::TaggedLogging.new(Syslog::Logger.new 'app-name') if ENV['RAILS_LOG_TO_STDOUT'].present? - logger = ActiveSupport::Logger.new($stdout) + logger = ActiveSupport::Logger.new(STDOUT) logger.formatter = config.log_formatter config.logger = ActiveSupport::TaggedLogging.new(logger) end # Do not dump schema after migrations. config.active_record.dump_schema_after_migration = false + + # Inserts middleware to perform automatic connection switching. + # The `database_selector` hash is used to pass options to the DatabaseSelector + # middleware. The `delay` is used to determine how long to wait after a write + # to send a subsequent read to the primary. + # + # The `database_resolver` class is used by the middleware to determine which + # database is appropriate to use based on the time delay. + # + # The `database_resolver_context` class is used by the middleware to set + # timestamps for the last write to the primary. The resolver uses the context + # class timestamps to determine how long to wait before reading from the + # replica. + # + # By default Rails will store a last write timestamp in the session. The + # DatabaseSelector middleware is designed as such you can define your own + # strategy for connection switching and pass that into the middleware through + # these configuration options. + # config.active_record.database_selector = { delay: 2.seconds } + # config.active_record.database_resolver = ActiveRecord::Middleware::DatabaseSelector::Resolver + # config.active_record.database_resolver_context = ActiveRecord::Middleware::DatabaseSelector::Resolver::Session end # Used by Rails' routes url_helpers (typically when including a link in an email) Rails.application.routes.default_url_options[:host] = 'example.org' diff --git a/config/environments/test.rb b/config/environments/test.rb index 0825f8d56a..26839f6069 100644 --- a/config/environments/test.rb +++ b/config/environments/test.rb @@ -1,4 +1,5 @@ # frozen_string_literal: true +require 'active_support/core_ext/integer/time' Rails.application.configure do # Settings specified here will take precedence over those in config/application.rb. @@ -8,6 +9,7 @@ # your test database is "scratch space" for the test suite and is wiped # and recreated between test runs. Don't rely on the data there! config.cache_classes = true + config.action_view.cache_template_loading = true # Do not eager load code on boot. This avoids loading your whole application # just for the purpose of running a single test. If you are using a tool that @@ -46,8 +48,17 @@ # Print deprecation notices to the stderr. config.active_support.deprecation = :stderr - # Raises error for missing translations - # config.action_view.raise_on_missing_translations = true + # Raise exceptions for disallowed deprecations. + config.active_support.disallowed_deprecation = :raise + + # Tell Active Support which deprecation messages to disallow. + config.active_support.disallowed_deprecation_warnings = [] + + # Raises error for missing translations. + # config.i18n.raise_on_missing_translations = true + + # Annotate rendered view with file names. + # config.action_view.annotate_rendered_view_with_filenames = true config.i18n.enforce_available_locales = false end diff --git a/config/initializers/backtrace_silencers.rb b/config/initializers/backtrace_silencers.rb index 5b98aef49a..e622a8dfd4 100644 --- a/config/initializers/backtrace_silencers.rb +++ b/config/initializers/backtrace_silencers.rb @@ -7,4 +7,4 @@ # You can also remove all the silencers if you're trying to debug a problem # that might stem from framework code. -# Rails.backtrace_cleaner.remove_silencers! +# Rails.backtrace_cleaner.remove_silencers! if ENV["BACKTRACE"] diff --git a/config/initializers/filter_parameter_logging.rb b/config/initializers/filter_parameter_logging.rb index 7a4f47b4c2..14bf0b1d21 100644 --- a/config/initializers/filter_parameter_logging.rb +++ b/config/initializers/filter_parameter_logging.rb @@ -3,4 +3,7 @@ # Be sure to restart your server when you modify this file. # Configure sensitive parameters which will be filtered from the log file. +# Rails.application.config.filter_parameters += [ +# :passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn +# ] Rails.application.config.filter_parameters += [:password] diff --git a/config/initializers/new_framework_defaults_6_1.rb b/config/initializers/new_framework_defaults_6_1.rb new file mode 100644 index 0000000000..9526b835ab --- /dev/null +++ b/config/initializers/new_framework_defaults_6_1.rb @@ -0,0 +1,67 @@ +# Be sure to restart your server when you modify this file. +# +# This file contains migration options to ease your Rails 6.1 upgrade. +# +# Once upgraded flip defaults one by one to migrate to the new default. +# +# Read the Guide for Upgrading Ruby on Rails for more info on each option. + +# Support for inversing belongs_to -> has_many Active Record associations. +# Rails.application.config.active_record.has_many_inversing = true + +# Track Active Storage variants in the database. +# Rails.application.config.active_storage.track_variants = true + +# Apply random variation to the delay when retrying failed jobs. +# Rails.application.config.active_job.retry_jitter = 0.15 + +# Stop executing `after_enqueue`/`after_perform` callbacks if +# `before_enqueue`/`before_perform` respectively halts with `throw :abort`. +# Rails.application.config.active_job.skip_after_callbacks_if_terminated = true + +# Specify cookies SameSite protection level: either :none, :lax, or :strict. +# +# This change is not backwards compatible with earlier Rails versions. +# It's best enabled when your entire app is migrated and stable on 6.1. +# Rails.application.config.action_dispatch.cookies_same_site_protection = :lax + +# Generate CSRF tokens that are encoded in URL-safe Base64. +# +# This change is not backwards compatible with earlier Rails versions. +# It's best enabled when your entire app is migrated and stable on 6.1. +# Rails.application.config.action_controller.urlsafe_csrf_tokens = true + +# Specify whether `ActiveSupport::TimeZone.utc_to_local` returns a time with an +# UTC offset or a UTC time. +# ActiveSupport.utc_to_local_returns_utc_offset_times = true + +# Change the default HTTP status code to `308` when redirecting non-GET/HEAD +# requests to HTTPS in `ActionDispatch::SSL` middleware. +# Rails.application.config.action_dispatch.ssl_default_redirect_status = 308 + +# Use new connection handling API. For most applications this won't have any +# effect. For applications using multiple databases, this new API provides +# support for granular connection swapping. +# Rails.application.config.active_record.legacy_connection_handling = false + +# Make `form_with` generate non-remote forms by default. +# Rails.application.config.action_view.form_with_generates_remote_forms = false + +# Set the default queue name for the analysis job to the queue adapter default. +# Rails.application.config.active_storage.queues.analysis = nil + +# Set the default queue name for the purge job to the queue adapter default. +# Rails.application.config.active_storage.queues.purge = nil + +# Set the default queue name for the incineration job to the queue adapter default. +# Rails.application.config.action_mailbox.queues.incineration = nil + +# Set the default queue name for the routing job to the queue adapter default. +# Rails.application.config.action_mailbox.queues.routing = nil + +# Set the default queue name for the mail deliver job to the queue adapter default. +# Rails.application.config.action_mailer.deliver_later_queue_name = nil + +# Generate a `Link` header that gives a hint to modern browsers about +# preloading assets when using `javascript_include_tag` and `stylesheet_link_tag`. +# Rails.application.config.action_view.preload_links_header = true diff --git a/config/initializers/permissions_policy.rb b/config/initializers/permissions_policy.rb new file mode 100644 index 0000000000..00f64d71b0 --- /dev/null +++ b/config/initializers/permissions_policy.rb @@ -0,0 +1,11 @@ +# Define an application-wide HTTP permissions policy. For further +# information see https://developers.google.com/web/updates/2018/06/feature-policy +# +# Rails.application.config.permissions_policy do |f| +# f.camera :none +# f.gyroscope :none +# f.microphone :none +# f.usb :none +# f.fullscreen :self +# f.payment :self, "https://secure.example.com" +# end diff --git a/config/spring.rb b/config/spring.rb index c5933e491b..37a3543421 100644 --- a/config/spring.rb +++ b/config/spring.rb @@ -1,8 +1,8 @@ # frozen_string_literal: true -%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" +)