Upgrade to Rails 7.0
The config.file_watcher option still exists but it's no longer included in the default environtment file. Since we don't use it, we're removing it. The config.assets.assets.debug option is no longer true by default [1], so it isn't included anymore. The config.active_support.deprecation option is now omitted on production in favor of config.active_support.report_deprecations, which is false by default. I think it's OK to keep it this way, since we check deprecations in the development and test environments but never on production environments. As mentioned in the Rails upgrade guide, sprockets-rails is no longer a rails dependency and we need to explicitly include it in our Gemfile. The behavior of queries trying to find an invalid enum value has changed [2], so we're updating the tests accordingly. The `favicon_link_tag` method has removed the deprecated `shortcut` link type [3], so we're updating the tests accordingly. The method `raw_filter` in ActiveSupport callbacks has been renamed to `filter` [4], so we're updating the code accordingly. [1] https://github.com/rails/rails/commit/adec7e7ba87e3 [2] https://github.com/rails/rails/commit/b68f0954 [3] Pull request 43850 in https://github.com/rails/rails [4] Pull request 41598 in https://github.com/rails/rails
This commit is contained in:
@@ -374,9 +374,6 @@ Rails/CreateTableWithTimestamps:
|
|||||||
Rails/Date:
|
Rails/Date:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
Rails/DeprecatedActiveModelErrorsMethods: # TODO: Remove after upgrading to Rails 7
|
|
||||||
Enabled: true
|
|
||||||
|
|
||||||
Rails/DurationArithmetic:
|
Rails/DurationArithmetic:
|
||||||
Enabled: true
|
Enabled: true
|
||||||
|
|
||||||
|
|||||||
3
Gemfile
3
Gemfile
@@ -1,6 +1,6 @@
|
|||||||
source "https://rubygems.org"
|
source "https://rubygems.org"
|
||||||
|
|
||||||
gem "rails", "6.1.7.7"
|
gem "rails", "7.0.8.1"
|
||||||
|
|
||||||
gem "acts-as-taggable-on", "~> 10.0.0"
|
gem "acts-as-taggable-on", "~> 10.0.0"
|
||||||
gem "acts_as_votable", "~> 0.14.0"
|
gem "acts_as_votable", "~> 0.14.0"
|
||||||
@@ -53,6 +53,7 @@ gem "savon", "~> 2.15.0"
|
|||||||
gem "sitemap_generator", "~> 6.3.0"
|
gem "sitemap_generator", "~> 6.3.0"
|
||||||
gem "social-share-button", "~> 1.2.4"
|
gem "social-share-button", "~> 1.2.4"
|
||||||
gem "sprockets", "~> 4.2.1"
|
gem "sprockets", "~> 4.2.1"
|
||||||
|
gem "sprockets-rails", "~> 3.4.2", require: "sprockets/railtie"
|
||||||
gem "turbolinks", "~> 5.2.1"
|
gem "turbolinks", "~> 5.2.1"
|
||||||
gem "turnout", "~> 2.5.0"
|
gem "turnout", "~> 2.5.0"
|
||||||
gem "uglifier", "~> 4.2.0"
|
gem "uglifier", "~> 4.2.0"
|
||||||
|
|||||||
127
Gemfile.lock
127
Gemfile.lock
@@ -2,65 +2,71 @@ GEM
|
|||||||
remote: https://rubygems.org/
|
remote: https://rubygems.org/
|
||||||
specs:
|
specs:
|
||||||
Ascii85 (1.1.0)
|
Ascii85 (1.1.0)
|
||||||
actioncable (6.1.7.7)
|
actioncable (7.0.8.1)
|
||||||
actionpack (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
nio4r (~> 2.0)
|
nio4r (~> 2.0)
|
||||||
websocket-driver (>= 0.6.1)
|
websocket-driver (>= 0.6.1)
|
||||||
actionmailbox (6.1.7.7)
|
actionmailbox (7.0.8.1)
|
||||||
actionpack (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
activejob (= 6.1.7.7)
|
activejob (= 7.0.8.1)
|
||||||
activerecord (= 6.1.7.7)
|
activerecord (= 7.0.8.1)
|
||||||
activestorage (= 6.1.7.7)
|
activestorage (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
mail (>= 2.7.1)
|
mail (>= 2.7.1)
|
||||||
actionmailer (6.1.7.7)
|
net-imap
|
||||||
actionpack (= 6.1.7.7)
|
net-pop
|
||||||
actionview (= 6.1.7.7)
|
net-smtp
|
||||||
activejob (= 6.1.7.7)
|
actionmailer (7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
|
actionview (= 7.0.8.1)
|
||||||
|
activejob (= 7.0.8.1)
|
||||||
|
activesupport (= 7.0.8.1)
|
||||||
mail (~> 2.5, >= 2.5.4)
|
mail (~> 2.5, >= 2.5.4)
|
||||||
|
net-imap
|
||||||
|
net-pop
|
||||||
|
net-smtp
|
||||||
rails-dom-testing (~> 2.0)
|
rails-dom-testing (~> 2.0)
|
||||||
actionpack (6.1.7.7)
|
actionpack (7.0.8.1)
|
||||||
actionview (= 6.1.7.7)
|
actionview (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
rack (~> 2.0, >= 2.0.9)
|
rack (~> 2.0, >= 2.2.4)
|
||||||
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.2.0)
|
rails-html-sanitizer (~> 1.0, >= 1.2.0)
|
||||||
actiontext (6.1.7.7)
|
actiontext (7.0.8.1)
|
||||||
actionpack (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
activerecord (= 6.1.7.7)
|
activerecord (= 7.0.8.1)
|
||||||
activestorage (= 6.1.7.7)
|
activestorage (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
|
globalid (>= 0.6.0)
|
||||||
nokogiri (>= 1.8.5)
|
nokogiri (>= 1.8.5)
|
||||||
actionview (6.1.7.7)
|
actionview (7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
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.1, >= 1.2.0)
|
rails-html-sanitizer (~> 1.1, >= 1.2.0)
|
||||||
activejob (6.1.7.7)
|
activejob (7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
globalid (>= 0.3.6)
|
globalid (>= 0.3.6)
|
||||||
activemodel (6.1.7.7)
|
activemodel (7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
activerecord (6.1.7.7)
|
activerecord (7.0.8.1)
|
||||||
activemodel (= 6.1.7.7)
|
activemodel (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
activestorage (6.1.7.7)
|
activestorage (7.0.8.1)
|
||||||
actionpack (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
activejob (= 6.1.7.7)
|
activejob (= 7.0.8.1)
|
||||||
activerecord (= 6.1.7.7)
|
activerecord (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
marcel (~> 1.0)
|
marcel (~> 1.0)
|
||||||
mini_mime (>= 1.1.0)
|
mini_mime (>= 1.1.0)
|
||||||
activesupport (6.1.7.7)
|
activesupport (7.0.8.1)
|
||||||
concurrent-ruby (~> 1.0, >= 1.0.2)
|
concurrent-ruby (~> 1.0, >= 1.0.2)
|
||||||
i18n (>= 1.6, < 2)
|
i18n (>= 1.6, < 2)
|
||||||
minitest (>= 5.1)
|
minitest (>= 5.1)
|
||||||
tzinfo (~> 2.0)
|
tzinfo (~> 2.0)
|
||||||
zeitwerk (~> 2.3)
|
|
||||||
acts-as-taggable-on (10.0.0)
|
acts-as-taggable-on (10.0.0)
|
||||||
activerecord (>= 6.1, < 7.2)
|
activerecord (>= 6.1, < 7.2)
|
||||||
acts_as_votable (0.14.0)
|
acts_as_votable (0.14.0)
|
||||||
@@ -91,7 +97,7 @@ GEM
|
|||||||
execjs (~> 2)
|
execjs (~> 2)
|
||||||
base64 (0.1.1)
|
base64 (0.1.1)
|
||||||
bcrypt (3.1.20)
|
bcrypt (3.1.20)
|
||||||
better_html (2.0.2)
|
better_html (2.1.1)
|
||||||
actionview (>= 6.0)
|
actionview (>= 6.0)
|
||||||
activesupport (>= 6.0)
|
activesupport (>= 6.0)
|
||||||
ast (~> 2.0)
|
ast (~> 2.0)
|
||||||
@@ -460,21 +466,20 @@ GEM
|
|||||||
rack
|
rack
|
||||||
rack-test (2.1.0)
|
rack-test (2.1.0)
|
||||||
rack (>= 1.3)
|
rack (>= 1.3)
|
||||||
rails (6.1.7.7)
|
rails (7.0.8.1)
|
||||||
actioncable (= 6.1.7.7)
|
actioncable (= 7.0.8.1)
|
||||||
actionmailbox (= 6.1.7.7)
|
actionmailbox (= 7.0.8.1)
|
||||||
actionmailer (= 6.1.7.7)
|
actionmailer (= 7.0.8.1)
|
||||||
actionpack (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
actiontext (= 6.1.7.7)
|
actiontext (= 7.0.8.1)
|
||||||
actionview (= 6.1.7.7)
|
actionview (= 7.0.8.1)
|
||||||
activejob (= 6.1.7.7)
|
activejob (= 7.0.8.1)
|
||||||
activemodel (= 6.1.7.7)
|
activemodel (= 7.0.8.1)
|
||||||
activerecord (= 6.1.7.7)
|
activerecord (= 7.0.8.1)
|
||||||
activestorage (= 6.1.7.7)
|
activestorage (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
bundler (>= 1.15.0)
|
bundler (>= 1.15.0)
|
||||||
railties (= 6.1.7.7)
|
railties (= 7.0.8.1)
|
||||||
sprockets-rails (>= 2.0.0)
|
|
||||||
rails-dom-testing (2.2.0)
|
rails-dom-testing (2.2.0)
|
||||||
activesupport (>= 5.0.0)
|
activesupport (>= 5.0.0)
|
||||||
minitest
|
minitest
|
||||||
@@ -482,15 +487,16 @@ GEM
|
|||||||
rails-html-sanitizer (1.6.0)
|
rails-html-sanitizer (1.6.0)
|
||||||
loofah (~> 2.21)
|
loofah (~> 2.21)
|
||||||
nokogiri (~> 1.14)
|
nokogiri (~> 1.14)
|
||||||
rails-i18n (6.0.0)
|
rails-i18n (7.0.9)
|
||||||
i18n (>= 0.7, < 2)
|
i18n (>= 0.7, < 2)
|
||||||
railties (>= 6.0.0, < 7)
|
railties (>= 6.0.0, < 8)
|
||||||
railties (6.1.7.7)
|
railties (7.0.8.1)
|
||||||
actionpack (= 6.1.7.7)
|
actionpack (= 7.0.8.1)
|
||||||
activesupport (= 6.1.7.7)
|
activesupport (= 7.0.8.1)
|
||||||
method_source
|
method_source
|
||||||
rake (>= 12.2)
|
rake (>= 12.2)
|
||||||
thor (~> 1.0)
|
thor (~> 1.0)
|
||||||
|
zeitwerk (~> 2.5)
|
||||||
rainbow (3.1.1)
|
rainbow (3.1.1)
|
||||||
rake (13.1.0)
|
rake (13.1.0)
|
||||||
rbtree3 (0.7.1)
|
rbtree3 (0.7.1)
|
||||||
@@ -752,7 +758,7 @@ DEPENDENCIES
|
|||||||
pronto-rubocop (~> 0.11.5)
|
pronto-rubocop (~> 0.11.5)
|
||||||
pronto-stylelint (~> 0.10.3)
|
pronto-stylelint (~> 0.10.3)
|
||||||
puma (~> 5.6.8)
|
puma (~> 5.6.8)
|
||||||
rails (= 6.1.7.7)
|
rails (= 7.0.8.1)
|
||||||
recipient_interceptor (~> 0.3.1)
|
recipient_interceptor (~> 0.3.1)
|
||||||
redcarpet (~> 3.6.0)
|
redcarpet (~> 3.6.0)
|
||||||
responders (~> 3.1.1)
|
responders (~> 3.1.1)
|
||||||
@@ -776,6 +782,7 @@ DEPENDENCIES
|
|||||||
social-share-button (~> 1.2.4)
|
social-share-button (~> 1.2.4)
|
||||||
spring (~> 4.1.3)
|
spring (~> 4.1.3)
|
||||||
sprockets (~> 4.2.1)
|
sprockets (~> 4.2.1)
|
||||||
|
sprockets-rails (~> 3.4.2)
|
||||||
turbolinks (~> 5.2.1)
|
turbolinks (~> 5.2.1)
|
||||||
turnout (~> 2.5.0)
|
turnout (~> 2.5.0)
|
||||||
uglifier (~> 4.2.0)
|
uglifier (~> 4.2.0)
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ module SkipValidation
|
|||||||
_validators[field].reject! { |existing_validator| existing_validator.is_a?(validator_class) }
|
_validators[field].reject! { |existing_validator| existing_validator.is_a?(validator_class) }
|
||||||
|
|
||||||
_validate_callbacks.each do |callback|
|
_validate_callbacks.each do |callback|
|
||||||
if callback.raw_filter.is_a?(validator_class)
|
if callback.filter.is_a?(validator_class)
|
||||||
callback.raw_filter.instance_variable_set(:@attributes, callback.raw_filter.attributes - [field])
|
callback.filter.instance_variable_set(:@attributes, callback.filter.attributes - [field])
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -13,7 +13,6 @@ require "action_mailer/railtie"
|
|||||||
# require "action_text/engine"
|
# require "action_text/engine"
|
||||||
require "action_view/railtie"
|
require "action_view/railtie"
|
||||||
require "action_cable/engine"
|
require "action_cable/engine"
|
||||||
require "sprockets/railtie"
|
|
||||||
require "rails/test_unit/railtie"
|
require "rails/test_unit/railtie"
|
||||||
|
|
||||||
# Require the gems listed in Gemfile, including any gems
|
# Require the gems listed in Gemfile, including any gems
|
||||||
|
|||||||
@@ -15,9 +15,12 @@ Rails.application.configure do
|
|||||||
# Show full error reports.
|
# Show full error reports.
|
||||||
config.consider_all_requests_local = true
|
config.consider_all_requests_local = true
|
||||||
|
|
||||||
|
# Enable server timing
|
||||||
|
config.server_timing = true
|
||||||
|
|
||||||
# Enable/disable caching. By default caching is disabled.
|
# Enable/disable caching. By default caching is disabled.
|
||||||
# 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.action_controller.enable_fragment_cache_logging = true
|
||||||
|
|
||||||
@@ -58,11 +61,6 @@ Rails.application.configure do
|
|||||||
# Highlight code that triggered database queries in logs.
|
# Highlight code that triggered database queries in logs.
|
||||||
config.active_record.verbose_query_logs = true
|
config.active_record.verbose_query_logs = true
|
||||||
|
|
||||||
# Debug mode disables concatenation and preprocessing of assets.
|
|
||||||
# This option may cause significant delays in view rendering with a large
|
|
||||||
# number of complex assets.
|
|
||||||
config.assets.debug = false
|
|
||||||
|
|
||||||
# Suppress logger output for asset requests.
|
# Suppress logger output for asset requests.
|
||||||
config.assets.quiet = true
|
config.assets.quiet = true
|
||||||
|
|
||||||
@@ -89,9 +87,6 @@ Rails.application.configure do
|
|||||||
Bullet.add_footer = true
|
Bullet.add_footer = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# 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.
|
# Uncomment if you wish to allow Action Cable access from any origin.
|
||||||
# config.action_cable.disable_request_forgery_protection = true
|
# config.action_cable.disable_request_forgery_protection = true
|
||||||
|
|||||||
@@ -74,18 +74,13 @@ Rails.application.configure do
|
|||||||
config.action_mailer.smtp_settings = Rails.application.secrets.smtp_settings
|
config.action_mailer.smtp_settings = Rails.application.secrets.smtp_settings
|
||||||
end
|
end
|
||||||
|
|
||||||
# Disable locale fallbacks for I18n
|
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
|
||||||
# (prevents using fallback locales set in application.rb).
|
# the I18n.default_locale when a translation cannot be found).
|
||||||
# config.i18n.fallbacks = false
|
# (commented because it prevents using fallback locales set in application.rb).
|
||||||
|
# config.i18n.fallbacks = true
|
||||||
|
|
||||||
# Send deprecation notices to registered listeners.
|
# Don't log any deprecations.
|
||||||
config.active_support.deprecation = :notify
|
config.active_support.report_deprecations = false
|
||||||
|
|
||||||
# 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.
|
# Use default logging formatter so that PID and timestamp are not suppressed.
|
||||||
config.log_formatter = ::Logger::Formatter.new
|
config.log_formatter = ::Logger::Formatter.new
|
||||||
@@ -107,27 +102,6 @@ Rails.application.configure do
|
|||||||
|
|
||||||
# Do not dump schema after migrations.
|
# Do not dump schema after migrations.
|
||||||
config.active_record.dump_schema_after_migration = false
|
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
|
end
|
||||||
|
|
||||||
require Rails.root.join("config", "environments", "custom", "production")
|
require Rails.root.join("config", "environments", "custom", "production")
|
||||||
|
|||||||
@@ -15,11 +15,12 @@ Rails.application.configure do
|
|||||||
config.i18n.default_locale = :en
|
config.i18n.default_locale = :en
|
||||||
config.i18n.available_locales = %w[de en es fr nl pt-BR zh-CN]
|
config.i18n.available_locales = %w[de en es fr nl pt-BR zh-CN]
|
||||||
|
|
||||||
|
# Turn false under Spring and add config.action_view.cache_template_loading = true.
|
||||||
config.cache_classes = true
|
config.cache_classes = true
|
||||||
|
|
||||||
# Do not eager load code on boot. This avoids loading your whole application
|
# Eager loading loads your whole application. When running a single test locally,
|
||||||
# just for the purpose of running a single test. If you are using a tool that
|
# this probably isn't necessary. It's a good idea to do in a continuous integration
|
||||||
# preloads Rails for running tests, you may have to set it to true.
|
# system, or in some way before deploying your code.
|
||||||
config.eager_load = ENV["CI"].present?
|
config.eager_load = ENV["CI"].present?
|
||||||
|
|
||||||
# Configure public file server for tests with Cache-Control for performance.
|
# Configure public file server for tests with Cache-Control for performance.
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Configure sensitive parameters which will be filtered from the log file.
|
# Configure parameters to be filtered from the log file. Use this to limit dissemination of
|
||||||
|
# sensitive information. See the ActiveSupport::ParameterFilter documentation for supported
|
||||||
|
# notations and behaviors.
|
||||||
Rails.application.config.filter_parameters += [
|
Rails.application.config.filter_parameters += [
|
||||||
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
:passw, :secret, :token, :_key, :crypt, :salt, :certificate, :otp, :ssn
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -1,28 +1,25 @@
|
|||||||
# Be sure to restart your server when you modify this file.
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
# Define an application-wide content security policy
|
# Define an application-wide content security policy.
|
||||||
# For further information see the following documentation
|
# See the Securing Rails Applications Guide for more information:
|
||||||
# https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Security-Policy
|
# https://guides.rubyonrails.org/security.html#content-security-policy-header
|
||||||
|
|
||||||
# Rails.application.config.content_security_policy do |policy|
|
# Rails.application.configure do
|
||||||
# policy.default_src :self, :https
|
# config.content_security_policy do |policy|
|
||||||
# policy.font_src :self, :https, :data
|
# policy.default_src :self, :https
|
||||||
# policy.img_src :self, :https, :data
|
# policy.font_src :self, :https, :data
|
||||||
# policy.object_src :none
|
# policy.img_src :self, :https, :data
|
||||||
# policy.script_src :self, :https
|
# policy.object_src :none
|
||||||
# policy.style_src :self, :https
|
# policy.script_src :self, :https
|
||||||
|
# policy.style_src :self, :https
|
||||||
# # Specify URI for violation reports
|
# # Specify URI for violation reports
|
||||||
# # policy.report_uri "/csp-violation-report-endpoint"
|
# # policy.report_uri "/csp-violation-report-endpoint"
|
||||||
|
# end
|
||||||
|
#
|
||||||
|
# # Generate session nonces for permitted importmap and inline scripts
|
||||||
|
# config.content_security_policy_nonce_generator = ->(request) { request.session.id.to_s }
|
||||||
|
# config.content_security_policy_nonce_directives = %w(script-src)
|
||||||
|
#
|
||||||
|
# # Report violations without enforcing the policy.
|
||||||
|
# # config.content_security_policy_report_only = true
|
||||||
# end
|
# end
|
||||||
|
|
||||||
# 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
|
|
||||||
# Rails.application.config.content_security_policy_report_only = true
|
|
||||||
|
|||||||
@@ -4,15 +4,15 @@
|
|||||||
# are locale specific, and you may define rules for as many different
|
# are locale specific, and you may define rules for as many different
|
||||||
# locales as you wish. All of these examples are active by default:
|
# locales as you wish. All of these examples are active by default:
|
||||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
# inflect.plural /^(ox)$/i, '\1en'
|
# inflect.plural /^(ox)$/i, "\\1en"
|
||||||
# inflect.singular /^(ox)en/i, '\1'
|
# inflect.singular /^(ox)en/i, "\\1"
|
||||||
# inflect.irregular 'person', 'people'
|
# inflect.irregular "person", "people"
|
||||||
# inflect.uncountable %w( fish sheep )
|
# inflect.uncountable %w( fish sheep )
|
||||||
# end
|
# end
|
||||||
|
|
||||||
# These inflection rules are supported but not enabled by default:
|
# These inflection rules are supported but not enabled by default:
|
||||||
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
# ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
# inflect.acronym 'RESTful'
|
# inflect.acronym "RESTful"
|
||||||
# end
|
# end
|
||||||
|
|
||||||
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
ActiveSupport::Inflector.inflections(:en) do |inflect|
|
||||||
|
|||||||
143
config/initializers/new_framework_defaults_7_0.rb
Normal file
143
config/initializers/new_framework_defaults_7_0.rb
Normal file
@@ -0,0 +1,143 @@
|
|||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
#
|
||||||
|
# This file eases your Rails 7.0 framework defaults upgrade.
|
||||||
|
#
|
||||||
|
# Uncomment each configuration one by one to switch to the new default.
|
||||||
|
# Once your application is ready to run with all new defaults, you can remove
|
||||||
|
# this file and set the `config.load_defaults` to `7.0`.
|
||||||
|
#
|
||||||
|
# Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
||||||
|
# https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
||||||
|
|
||||||
|
# `button_to` view helper will render `<button>` element, regardless of whether
|
||||||
|
# or not the content is passed as the first argument or as a block.
|
||||||
|
# Rails.application.config.action_view.button_to_generates_button_tag = true
|
||||||
|
|
||||||
|
# `stylesheet_link_tag` view helper will not render the media attribute by default.
|
||||||
|
# Rails.application.config.action_view.apply_stylesheet_media_default = false
|
||||||
|
|
||||||
|
# Change the digest class for the key generators to `OpenSSL::Digest::SHA256`.
|
||||||
|
# Changing this default means invalidate all encrypted messages generated by
|
||||||
|
# your application and, all the encrypted cookies. Only change this after you
|
||||||
|
# rotated all the messages using the key rotator.
|
||||||
|
#
|
||||||
|
# See upgrading guide for more information on how to build a rotator.
|
||||||
|
# https://guides.rubyonrails.org/v7.0/upgrading_ruby_on_rails.html
|
||||||
|
# Rails.application.config.active_support.key_generator_hash_digest_class = OpenSSL::Digest::SHA256
|
||||||
|
|
||||||
|
# Change the digest class for ActiveSupport::Digest.
|
||||||
|
# Changing this default means that for example Etags change and
|
||||||
|
# various cache keys leading to cache invalidation.
|
||||||
|
# Rails.application.config.active_support.hash_digest_class = OpenSSL::Digest::SHA256
|
||||||
|
|
||||||
|
# Don't override ActiveSupport::TimeWithZone.name and use the default Ruby
|
||||||
|
# implementation.
|
||||||
|
# Rails.application.config.active_support.remove_deprecated_time_with_zone_name = true
|
||||||
|
|
||||||
|
# Calls `Rails.application.executor.wrap` around test cases.
|
||||||
|
# This makes test cases behave closer to an actual request or job.
|
||||||
|
# Several features that are normally disabled in test, such as Active Record query cache
|
||||||
|
# and asynchronous queries will then be enabled.
|
||||||
|
# Rails.application.config.active_support.executor_around_test_case = true
|
||||||
|
|
||||||
|
# Set both the `:open_timeout` and `:read_timeout` values for `:smtp` delivery method.
|
||||||
|
# Rails.application.config.action_mailer.smtp_timeout = 5
|
||||||
|
|
||||||
|
# The ActiveStorage video previewer will now use scene change detection to generate
|
||||||
|
# better preview images (rather than the previous default of using the first frame
|
||||||
|
# of the video).
|
||||||
|
# Rails.application.config.active_storage.video_preview_arguments =
|
||||||
|
# "-vf 'select=eq(n\\,0)+eq(key\\,1)+gt(scene\\,0.015),loop=loop=-1:size=2,trim=start_frame=1' -frames:v 1 -f image2"
|
||||||
|
|
||||||
|
# Automatically infer `inverse_of` for associations with a scope.
|
||||||
|
# Rails.application.config.active_record.automatic_scope_inversing = true
|
||||||
|
|
||||||
|
# Raise when running tests if fixtures contained foreign key violations
|
||||||
|
# Rails.application.config.active_record.verify_foreign_keys_for_fixtures = true
|
||||||
|
|
||||||
|
# Disable partial inserts.
|
||||||
|
# This default means that all columns will be referenced in INSERT queries
|
||||||
|
# regardless of whether they have a default or not.
|
||||||
|
# Rails.application.config.active_record.partial_inserts = false
|
||||||
|
|
||||||
|
# Protect from open redirect attacks in `redirect_back_or_to` and `redirect_to`.
|
||||||
|
# Rails.application.config.action_controller.raise_on_open_redirects = true
|
||||||
|
|
||||||
|
# Change the variant processor for Active Storage.
|
||||||
|
# Changing this default means updating all places in your code that
|
||||||
|
# generate variants to use image processing macros and ruby-vips
|
||||||
|
# operations. See the upgrading guide for detail on the changes required.
|
||||||
|
# The `:mini_magick` option is not deprecated; it's fine to keep using it.
|
||||||
|
# Rails.application.config.active_storage.variant_processor = :vips
|
||||||
|
|
||||||
|
# Enable parameter wrapping for JSON.
|
||||||
|
# Previously this was set in an initializer. It's fine to keep using that initializer if you've customized it.
|
||||||
|
# To disable parameter wrapping entirely, set this config to `false`.
|
||||||
|
# Rails.application.config.action_controller.wrap_parameters_by_default = true
|
||||||
|
|
||||||
|
# Specifies whether generated namespaced UUIDs follow the RFC 4122 standard for namespace IDs provided as a
|
||||||
|
# `String` to `Digest::UUID.uuid_v3` or `Digest::UUID.uuid_v5` method calls.
|
||||||
|
#
|
||||||
|
# See https://guides.rubyonrails.org/configuring.html#config-active-support-use-rfc4122-namespaced-uuids for
|
||||||
|
# more information.
|
||||||
|
# Rails.application.config.active_support.use_rfc4122_namespaced_uuids = true
|
||||||
|
|
||||||
|
# Change the default headers to disable browsers' flawed legacy XSS protection.
|
||||||
|
# Rails.application.config.action_dispatch.default_headers = {
|
||||||
|
# "X-Frame-Options" => "SAMEORIGIN",
|
||||||
|
# "X-XSS-Protection" => "0",
|
||||||
|
# "X-Content-Type-Options" => "nosniff",
|
||||||
|
# "X-Download-Options" => "noopen",
|
||||||
|
# "X-Permitted-Cross-Domain-Policies" => "none",
|
||||||
|
# "Referrer-Policy" => "strict-origin-when-cross-origin"
|
||||||
|
# }
|
||||||
|
|
||||||
|
|
||||||
|
# ** Please read carefully, this must be configured in config/application.rb **
|
||||||
|
# Change the format of the cache entry.
|
||||||
|
# Changing this default means that all new cache entries added to the cache
|
||||||
|
# will have a different format that is not supported by Rails 6.1 applications.
|
||||||
|
# Only change this value after your application is fully deployed to Rails 7.0
|
||||||
|
# and you have no plans to rollback.
|
||||||
|
# When you're ready to change format, add this to `config/application.rb` (NOT this file):
|
||||||
|
# config.active_support.cache_format_version = 7.0
|
||||||
|
|
||||||
|
|
||||||
|
# Cookie serializer: 2 options
|
||||||
|
#
|
||||||
|
# If you're upgrading and haven't set `cookies_serializer` previously, your cookie serializer
|
||||||
|
# is `:marshal`. The default for new apps is `:json`.
|
||||||
|
#
|
||||||
|
# Rails.application.config.action_dispatch.cookies_serializer = :json
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# To migrate an existing application to the `:json` serializer, use the `:hybrid` option.
|
||||||
|
#
|
||||||
|
# Rails transparently deserializes existing (Marshal-serialized) cookies on read and
|
||||||
|
# re-writes them in the JSON format.
|
||||||
|
#
|
||||||
|
# It is fine to use `:hybrid` long term; you should do that until you're confident *all* your cookies
|
||||||
|
# have been converted to JSON. To keep using `:hybrid` long term, move this config to its own
|
||||||
|
# initializer or to `config/application.rb`.
|
||||||
|
#
|
||||||
|
# Rails.application.config.action_dispatch.cookies_serializer = :hybrid
|
||||||
|
#
|
||||||
|
#
|
||||||
|
# If your cookies can't yet be serialized to JSON, keep using `:marshal` for backward-compatibility.
|
||||||
|
#
|
||||||
|
# If you have configured the serializer elsewhere, you can remove this section of the file.
|
||||||
|
#
|
||||||
|
# See https://guides.rubyonrails.org/action_controller_overview.html#cookies for more information.
|
||||||
|
|
||||||
|
# Change the return value of `ActionDispatch::Request#content_type` to the Content-Type header without modification.
|
||||||
|
# Rails.application.config.action_dispatch.return_only_request_media_type_on_content_type = false
|
||||||
|
|
||||||
|
# Active Storage `has_many_attached` relationships will default to replacing the current collection instead of appending to it.
|
||||||
|
# Thus, to support submitting an empty collection, the `file_field` helper will render an hidden field `include_hidden` by default when `multiple_file_field_include_hidden` is set to `true`.
|
||||||
|
# See https://guides.rubyonrails.org/configuring.html#config-active-storage-multiple-file-field-include-hidden for more information.
|
||||||
|
# Rails.application.config.active_storage.multiple_file_field_include_hidden = true
|
||||||
|
|
||||||
|
# ** Please read carefully, this must be configured in config/application.rb (NOT this file) **
|
||||||
|
# Disables the deprecated #to_s override in some Ruby core classes
|
||||||
|
# See https://guides.rubyonrails.org/configuring.html#config-active-support-disable-to-s-conversion for more information.
|
||||||
|
# config.active_support.disable_to_s_conversion = true
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
# This migration comes from active_storage (originally 20211119233751)
|
||||||
|
class RemoveNotNullOnActiveStorageBlobsChecksum < ActiveRecord::Migration[6.0]
|
||||||
|
def change
|
||||||
|
return unless table_exists?(:active_storage_blobs)
|
||||||
|
|
||||||
|
change_column_null(:active_storage_blobs, :checksum, true)
|
||||||
|
end
|
||||||
|
end
|
||||||
625
db/schema.rb
625
db/schema.rb
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@ describe SDG::Phase do
|
|||||||
end
|
end
|
||||||
|
|
||||||
it "raises an exception for non-existing kinds" do
|
it "raises an exception for non-existing kinds" do
|
||||||
expect { SDG::Phase["improvement"] }.to raise_exception ActiveRecord::StatementInvalid
|
expect { SDG::Phase["improvement"] }.to raise_exception ActiveRecord::RecordNotFound
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ describe "Site customization images" do
|
|||||||
|
|
||||||
visit root_path
|
visit root_path
|
||||||
|
|
||||||
expect(page).to have_css("link[rel='shortcut icon'][href$='favicon_custom.ico']", visible: :hidden)
|
expect(page).to have_css("link[rel='icon'][href$='favicon_custom.ico']", visible: :hidden)
|
||||||
end
|
end
|
||||||
|
|
||||||
scenario "Custom auth background" do
|
scenario "Custom auth background" do
|
||||||
|
|||||||
Reference in New Issue
Block a user