annotate config/initializers/new_framework_defaults_5_2.rb @ 467:fd3078b4d355

Update to latest rails
author nanaya <me@nanaya.pro>
date Tue, 22 Oct 2019 16:17:30 +0900
parents 07d6c6639adf
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
459
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
1 # Be sure to restart your server when you modify this file.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
2 #
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
3 # This file contains migration options to ease your Rails 5.2 upgrade.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
4 #
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
5 # Once upgraded flip defaults one by one to migrate to the new default.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
6 #
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
7 # Read the Guide for Upgrading Ruby on Rails for more info on each option.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
8
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
9 # Make Active Record use stable #cache_key alongside new #cache_version method.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
10 # This is needed for recyclable cache keys.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
11 # Rails.application.config.active_record.cache_versioning = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
12
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
13 # Use AES-256-GCM authenticated encryption for encrypted cookies.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
14 # Also, embed cookie expiry in signed or encrypted cookies for increased security.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
15 #
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
16 # This option is not backwards compatible with earlier Rails versions.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
17 # It's best enabled when your entire app is migrated and stable on 5.2.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
18 #
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
19 # Existing cookies will be converted on read then written with the new scheme.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
20 # Rails.application.config.action_dispatch.use_authenticated_cookie_encryption = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
21
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
22 # Use AES-256-GCM authenticated encryption as default cipher for encrypting messages
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
23 # instead of AES-256-CBC, when use_authenticated_message_encryption is set to true.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
24 # Rails.application.config.active_support.use_authenticated_message_encryption = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
25
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
26 # Add default protection from forgery to ActionController::Base instead of in
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
27 # ApplicationController.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
28 # Rails.application.config.action_controller.default_protect_from_forgery = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
29
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
30 # Store boolean values are in sqlite3 databases as 1 and 0 instead of 't' and
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
31 # 'f' after migrating old data.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
32 # Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
33
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
34 # Use SHA-1 instead of MD5 to generate non-sensitive digests, such as the ETag header.
07d6c6639adf Upgrade to rails 5.2. RIP code style.
nanaya <me@nanaya.pro>
parents:
diff changeset
35 # Rails.application.config.active_support.use_sha1_digests = true