|
9 | 9 | # Read the Guide for Upgrading Ruby on Rails for more info on each option.
|
10 | 10 | # https://guides.rubyonrails.org/upgrading_ruby_on_rails.html
|
11 | 11 |
|
12 |
| -### |
13 |
| -# No longer add autoloaded paths into `$LOAD_PATH`. This means that you won't be able |
14 |
| -# to manually require files that are managed by the autoloader, which you shouldn't do anyway. |
15 |
| -# |
16 |
| -# This will reduce the size of the load path, making `require` faster if you don't use bootsnap, or reduce the size |
17 |
| -# of the bootsnap cache if you use it. |
18 |
| -# |
19 |
| -# To set this configuration, add the following line to `config/application.rb` (NOT this file): |
20 |
| -# config.add_autoload_paths_to_load_path = false |
21 |
| - |
22 | 12 | ###
|
23 | 13 | # Remove the default X-Download-Options headers since it is used only by Internet Explorer.
|
24 | 14 | # If you need to support Internet Explorer, add back `"X-Download-Options" => "noopen"`.
|
25 | 15 | #++
|
26 |
| -# Rails.application.config.action_dispatch.default_headers = { |
27 |
| -# "X-Frame-Options" => "SAMEORIGIN", |
28 |
| -# "X-XSS-Protection" => "0", |
29 |
| -# "X-Content-Type-Options" => "nosniff", |
30 |
| -# "X-Permitted-Cross-Domain-Policies" => "none", |
31 |
| -# "Referrer-Policy" => "strict-origin-when-cross-origin" |
32 |
| -# } |
| 16 | +Rails.application.config.action_dispatch.default_headers = { |
| 17 | + "X-Frame-Options" => "SAMEORIGIN", |
| 18 | + "X-XSS-Protection" => "0", |
| 19 | + "X-Content-Type-Options" => "nosniff", |
| 20 | + "X-Permitted-Cross-Domain-Policies" => "none", |
| 21 | + "Referrer-Policy" => "strict-origin-when-cross-origin" |
| 22 | +} |
33 | 23 |
|
34 | 24 | ###
|
35 | 25 | # Do not treat an `ActionController::Parameters` instance
|
36 | 26 | # as equal to an equivalent `Hash` by default.
|
37 | 27 | #++
|
38 |
| -# Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false |
| 28 | +Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false |
39 | 29 |
|
40 | 30 | ###
|
41 | 31 | # Active Record Encryption now uses SHA-256 as its hash digest algorithm.
|
|
56 | 46 | # 3. If you don't currently have data encrypted with Active Record encryption, you can disable this setting to
|
57 | 47 | # configure the default behavior starting 7.1+:
|
58 | 48 | #++
|
59 |
| -# Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false |
| 49 | +Rails.application.config.active_record.encryption.support_sha1_for_non_deterministic_encryption = false |
60 | 50 |
|
61 | 51 | ###
|
62 | 52 | # No longer run after_commit callbacks on the first of multiple Active Record
|
|
65 | 55 | # state which matches what was committed to the database, typically the last
|
66 | 56 | # instance to save.
|
67 | 57 | #++
|
68 |
| -# Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false |
| 58 | +Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false |
69 | 59 |
|
70 | 60 | ###
|
71 | 61 | # Configures SQLite with a strict strings mode, which disables double-quoted string literals.
|
|
76 | 66 | # For example, it is possible to create an index for a non existing column.
|
77 | 67 | # See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details.
|
78 | 68 | #++
|
79 |
| -# Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true |
| 69 | +Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true |
80 | 70 |
|
81 | 71 | ###
|
82 | 72 | # Disable deprecated singular associations names.
|
83 | 73 | #++
|
84 |
| -# Rails.application.config.active_record.allow_deprecated_singular_associations_name = false |
| 74 | +Rails.application.config.active_record.allow_deprecated_singular_associations_name = false |
85 | 75 |
|
86 | 76 | ###
|
87 | 77 | # Enable the Active Job `BigDecimal` argument serializer, which guarantees
|
|
93 | 83 | # serializer. Therefore, this setting should only be enabled after all replicas
|
94 | 84 | # have been successfully upgraded to Rails 7.1.
|
95 | 85 | #++
|
96 |
| -# Rails.application.config.active_job.use_big_decimal_serializer = true |
| 86 | +Rails.application.config.active_job.use_big_decimal_serializer = true |
97 | 87 |
|
98 | 88 | ###
|
99 | 89 | # Specify if an `ArgumentError` should be raised if `Rails.cache` `fetch` or
|
100 | 90 | # `write` are given an invalid `expires_at` or `expires_in` time.
|
101 | 91 | # Options are `true`, and `false`. If `false`, the exception will be reported
|
102 | 92 | # as `handled` and logged instead.
|
103 | 93 | #++
|
104 |
| -# Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true |
| 94 | +Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true |
105 | 95 |
|
106 | 96 | ###
|
107 | 97 | # Specify whether Query Logs will format tags using the SQLCommenter format
|
108 | 98 | # (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format.
|
109 | 99 | # Options are `:legacy` and `:sqlcommenter`.
|
110 | 100 | #++
|
111 |
| -# Rails.application.config.active_record.query_log_tags_format = :sqlcommenter |
| 101 | +Rails.application.config.active_record.query_log_tags_format = :sqlcommenter |
112 | 102 |
|
113 | 103 | ###
|
114 | 104 | # Specify the default serializer used by `MessageEncryptor` and `MessageVerifier`
|
|
138 | 128 | # servers, first deploy without changing the serializer, then set the serializer
|
139 | 129 | # in a subsequent deploy.
|
140 | 130 | #++
|
141 |
| -# Rails.application.config.active_support.message_serializer = :json_allow_marshal |
| 131 | +Rails.application.config.active_support.message_serializer = :json_allow_marshal |
142 | 132 |
|
143 | 133 | ###
|
144 | 134 | # Enable a performance optimization that serializes message data and metadata
|
|
151 | 141 | # leave this optimization off on the first deploy, then enable it on a
|
152 | 142 | # subsequent deploy.
|
153 | 143 | #++
|
154 |
| -# Rails.application.config.active_support.use_message_serializer_for_metadata = true |
| 144 | +Rails.application.config.active_support.use_message_serializer_for_metadata = true |
155 | 145 |
|
156 | 146 | ###
|
157 | 147 | # Set the maximum size for Rails log files.
|
158 | 148 | #
|
159 | 149 | # `config.load_defaults 7.1` does not set this value for environments other than
|
160 | 150 | # development and test.
|
161 | 151 | #++
|
162 |
| -# if Rails.env.local? |
163 |
| -# Rails.application.config.log_file_size = 100 * 1024 * 1024 |
164 |
| -# end |
| 152 | +if Rails.env.local? |
| 153 | + Rails.application.config.log_file_size = 100 * 1024 * 1024 |
| 154 | +end |
165 | 155 |
|
166 | 156 | ###
|
167 | 157 | # Enable raising on assignment to attr_readonly attributes. The previous
|
168 | 158 | # behavior would allow assignment but silently not persist changes to the
|
169 | 159 | # database.
|
170 | 160 | #++
|
171 |
| -# Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true |
| 161 | +Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true |
172 | 162 |
|
173 | 163 | ###
|
174 | 164 | # Enable validating only parent-related columns for presence when the parent is mandatory.
|
175 | 165 | # The previous behavior was to validate the presence of the parent record, which performed an extra query
|
176 | 166 | # to get the parent every time the child record was updated, even when parent has not changed.
|
177 | 167 | #++
|
178 |
| -# Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false |
| 168 | +Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false |
179 | 169 |
|
180 | 170 | ###
|
181 | 171 | # Enable precompilation of `config.filter_parameters`. Precompilation can
|
182 | 172 | # improve filtering performance, depending on the quantity and types of filters.
|
183 | 173 | #++
|
184 |
| -# Rails.application.config.precompile_filter_parameters = true |
| 174 | +Rails.application.config.precompile_filter_parameters = true |
185 | 175 |
|
186 | 176 | ###
|
187 | 177 | # Enable before_committed! callbacks on all enrolled records in a transaction.
|
188 | 178 | # The previous behavior was to only run the callbacks on the first copy of a record
|
189 | 179 | # if there were multiple copies of the same record enrolled in the transaction.
|
190 | 180 | #++
|
191 |
| -# Rails.application.config.active_record.before_committed_on_all_records = true |
| 181 | +Rails.application.config.active_record.before_committed_on_all_records = true |
192 | 182 |
|
193 | 183 | ###
|
194 | 184 | # Disable automatic column serialization into YAML.
|
195 | 185 | # To keep the historic behavior, you can set it to `YAML`, however it is
|
196 | 186 | # recommended to explicitly define the serialization method for each column
|
197 | 187 | # rather than to rely on a global default.
|
198 | 188 | #++
|
199 |
| -# Rails.application.config.active_record.default_column_serializer = nil |
| 189 | +Rails.application.config.active_record.default_column_serializer = nil |
200 | 190 |
|
201 | 191 | ###
|
202 | 192 | # Enable a performance optimization that serializes Active Record models
|
|
207 | 197 | # leave this optimization off on the first deploy, then enable it on a
|
208 | 198 | # subsequent deploy.
|
209 | 199 | #++
|
210 |
| -# Rails.application.config.active_record.marshalling_format_version = 7.1 |
| 200 | +Rails.application.config.active_record.marshalling_format_version = 7.1 |
211 | 201 |
|
212 | 202 | ###
|
213 | 203 | # Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model.
|
214 | 204 | # This matches the behaviour of all other callbacks.
|
215 | 205 | # In previous versions of Rails, they ran in the inverse order.
|
216 | 206 | #++
|
217 |
| -# Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true |
| 207 | +Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true |
218 | 208 |
|
219 | 209 | ###
|
220 | 210 | # Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`.
|
221 | 211 | #++
|
222 |
| -# Rails.application.config.active_record.commit_transaction_on_non_local_return = true |
| 212 | +Rails.application.config.active_record.commit_transaction_on_non_local_return = true |
223 | 213 |
|
224 | 214 | ###
|
225 | 215 | # Controls when to generate a value for <tt>has_secure_token</tt> declarations.
|
226 | 216 | #++
|
227 |
| -# Rails.application.config.active_record.generate_secure_token_on = :initialize |
228 |
| - |
229 |
| -### |
230 |
| -# ** Please read carefully, this must be configured in config/application.rb ** |
231 |
| -# |
232 |
| -# Change the format of the cache entry. |
233 |
| -# |
234 |
| -# Changing this default means that all new cache entries added to the cache |
235 |
| -# will have a different format that is not supported by Rails 7.0 |
236 |
| -# applications. |
237 |
| -# |
238 |
| -# Only change this value after your application is fully deployed to Rails 7.1 |
239 |
| -# and you have no plans to rollback. |
240 |
| -# When you're ready to change format, add this to `config/application.rb` (NOT |
241 |
| -# this file): |
242 |
| -# config.active_support.cache_format_version = 7.1 |
| 217 | +Rails.application.config.active_record.generate_secure_token_on = :initialize |
243 | 218 |
|
244 | 219 | ###
|
245 | 220 | # Configure Action View to use HTML5 standards-compliant sanitizers when they are supported on your
|
|
250 | 225 | #
|
251 | 226 | # In previous versions of Rails, Action View always used `Rails::HTML4::Sanitizer` as its vendor.
|
252 | 227 | #++
|
253 |
| -# Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor |
| 228 | +Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor |
254 | 229 |
|
255 | 230 | ###
|
256 | 231 | # Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your
|
|
261 | 236 | #
|
262 | 237 | # In previous versions of Rails, Action Text always used `Rails::HTML4::Sanitizer` as its vendor.
|
263 | 238 | #++
|
264 |
| -# Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor |
| 239 | +Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor |
265 | 240 |
|
266 | 241 | ###
|
267 | 242 | # Configure the log level used by the DebugExceptions middleware when logging
|
268 | 243 | # uncaught exceptions during requests.
|
269 | 244 | #++
|
270 |
| -# Rails.application.config.action_dispatch.debug_exception_log_level = :error |
| 245 | +Rails.application.config.action_dispatch.debug_exception_log_level = :error |
271 | 246 |
|
272 | 247 | ###
|
273 | 248 | # Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5
|
|
277 | 252 | #
|
278 | 253 | # In previous versions of Rails, these test helpers always used an HTML4 parser.
|
279 | 254 | #++
|
280 |
| -# Rails.application.config.dom_testing_default_html_version = :html5 |
| 255 | +Rails.application.config.dom_testing_default_html_version = :html5 |
0 commit comments