Skip to content

Commit 67e2770

Browse files
committed
Comment out unnecessary settings if set to 'config.load_defaults 7.1' #1686
1 parent 4b6fd6d commit 67e2770

File tree

2 files changed

+26
-37
lines changed

2 files changed

+26
-37
lines changed

config/application.rb

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
module CoderdojoJp
1010
class Application < Rails::Application
1111
# Initialize configuration defaults for originally generated Rails version.
12+
# Each version's default can be checked at `config/initializers/new_framework_defaults_*.rb`
1213
config.load_defaults 7.1
1314

1415
# パフォーマンス最適化: autoloadパスを$LOAD_PATHに追加しない
@@ -33,18 +34,6 @@ class Application < Rails::Application
3334
# Default I18n locale
3435
config.i18n.default_locale = :ja
3536

36-
# セキュリティヘッダーの設定
37-
config.action_dispatch.default_headers = {
38-
"X-Frame-Options" => "SAMEORIGIN",
39-
"X-XSS-Protection" => "0",
40-
"X-Content-Type-Options" => "nosniff",
41-
"X-Permitted-Cross-Domain-Policies" => "none",
42-
"Referrer-Policy" => "strict-origin-when-cross-origin"
43-
}
44-
45-
# HTML5サニタイザーの使用
46-
config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
47-
4837
# Fixture paths
4938
config.fixture_paths = [Rails.root.join('spec/fixtures')]
5039
end

config/initializers/new_framework_defaults_7_1.rb

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
# Do not treat an `ActionController::Parameters` instance
3636
# as equal to an equivalent `Hash` by default.
3737
#++
38-
Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false
38+
#Rails.application.config.action_controller.allow_deprecated_parameters_hash_equality = false
3939

4040
###
4141
# Active Record Encryption now uses SHA-256 as its hash digest algorithm.
@@ -65,7 +65,7 @@
6565
# state which matches what was committed to the database, typically the last
6666
# instance to save.
6767
#++
68-
Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false
68+
#Rails.application.config.active_record.run_commit_callbacks_on_first_saved_instances_in_transaction = false
6969

7070
###
7171
# Configures SQLite with a strict strings mode, which disables double-quoted string literals.
@@ -76,12 +76,12 @@
7676
# For example, it is possible to create an index for a non existing column.
7777
# See https://www.sqlite.org/quirks.html#double_quoted_string_literals_are_accepted for more details.
7878
#++
79-
Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true
79+
#Rails.application.config.active_record.sqlite3_adapter_strict_strings_by_default = true
8080

8181
###
8282
# Disable deprecated singular associations names.
8383
#++
84-
Rails.application.config.active_record.allow_deprecated_singular_associations_name = false
84+
#Rails.application.config.active_record.allow_deprecated_singular_associations_name = false
8585

8686
###
8787
# Enable the Active Job `BigDecimal` argument serializer, which guarantees
@@ -101,14 +101,14 @@
101101
# Options are `true`, and `false`. If `false`, the exception will be reported
102102
# as `handled` and logged instead.
103103
#++
104-
Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true
104+
#Rails.application.config.active_support.raise_on_invalid_cache_expiration_time = true
105105

106106
###
107107
# Specify whether Query Logs will format tags using the SQLCommenter format
108108
# (https://open-telemetry.github.io/opentelemetry-sqlcommenter/), or using the legacy format.
109109
# Options are `:legacy` and `:sqlcommenter`.
110110
#++
111-
Rails.application.config.active_record.query_log_tags_format = :sqlcommenter
111+
#Rails.application.config.active_record.query_log_tags_format = :sqlcommenter
112112

113113
###
114114
# Specify the default serializer used by `MessageEncryptor` and `MessageVerifier`
@@ -138,7 +138,7 @@
138138
# servers, first deploy without changing the serializer, then set the serializer
139139
# in a subsequent deploy.
140140
#++
141-
Rails.application.config.active_support.message_serializer = :json_allow_marshal
141+
#Rails.application.config.active_support.message_serializer = :json_allow_marshal
142142

143143
###
144144
# Enable a performance optimization that serializes message data and metadata
@@ -151,59 +151,59 @@
151151
# leave this optimization off on the first deploy, then enable it on a
152152
# subsequent deploy.
153153
#++
154-
Rails.application.config.active_support.use_message_serializer_for_metadata = true
154+
#Rails.application.config.active_support.use_message_serializer_for_metadata = true
155155

156156
###
157157
# Set the maximum size for Rails log files.
158158
#
159159
# `config.load_defaults 7.1` does not set this value for environments other than
160160
# development and test.
161161
#++
162-
if Rails.env.local?
163-
Rails.application.config.log_file_size = 100 * 1024 * 1024
164-
end
162+
#if Rails.env.local?
163+
# Rails.application.config.log_file_size = 100 * 1024 * 1024
164+
#end
165165

166166
###
167167
# Enable raising on assignment to attr_readonly attributes. The previous
168168
# behavior would allow assignment but silently not persist changes to the
169169
# database.
170170
#++
171-
Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true
171+
#Rails.application.config.active_record.raise_on_assign_to_attr_readonly = true
172172

173173
###
174174
# Enable validating only parent-related columns for presence when the parent is mandatory.
175175
# The previous behavior was to validate the presence of the parent record, which performed an extra query
176176
# to get the parent every time the child record was updated, even when parent has not changed.
177177
#++
178-
Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false
178+
#Rails.application.config.active_record.belongs_to_required_validates_foreign_key = false
179179

180180
###
181181
# Enable precompilation of `config.filter_parameters`. Precompilation can
182182
# improve filtering performance, depending on the quantity and types of filters.
183183
#++
184-
Rails.application.config.precompile_filter_parameters = true
184+
#Rails.application.config.precompile_filter_parameters = true
185185

186186
###
187187
# Enable automatic setting of inverse_of for has_many associations.
188188
# This will automatically set the inverse_of option for has_many associations
189189
# when the inverse association is defined.
190190
#++
191-
Rails.application.config.active_record.automatic_scope_inversing = true
191+
#Rails.application.config.active_record.automatic_scope_inversing = true
192192

193193
###
194194
# Enable before_committed! callbacks on all enrolled records in a transaction.
195195
# The previous behavior was to only run the callbacks on the first copy of a record
196196
# if there were multiple copies of the same record enrolled in the transaction.
197197
#++
198-
Rails.application.config.active_record.before_committed_on_all_records = true
198+
#Rails.application.config.active_record.before_committed_on_all_records = true
199199

200200
###
201201
# Disable automatic column serialization into YAML.
202202
# To keep the historic behavior, you can set it to `YAML`, however it is
203203
# recommended to explicitly define the serialization method for each column
204204
# rather than to rely on a global default.
205205
#++
206-
Rails.application.config.active_record.default_column_serializer = nil
206+
#Rails.application.config.active_record.default_column_serializer = nil
207207

208208
###
209209
# Enable a performance optimization that serializes Active Record models
@@ -214,24 +214,24 @@
214214
# leave this optimization off on the first deploy, then enable it on a
215215
# subsequent deploy.
216216
#++
217-
Rails.application.config.active_record.marshalling_format_version = 7.1
217+
#Rails.application.config.active_record.marshalling_format_version = 7.1
218218

219219
###
220220
# Run `after_commit` and `after_*_commit` callbacks in the order they are defined in a model.
221221
# This matches the behaviour of all other callbacks.
222222
# In previous versions of Rails, they ran in the inverse order.
223223
#++
224-
Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true
224+
#Rails.application.config.active_record.run_after_transaction_callbacks_in_order_defined = true
225225

226226
###
227227
# Whether a `transaction` block is committed or rolled back when exited via `return`, `break` or `throw`.
228228
#++
229-
Rails.application.config.active_record.commit_transaction_on_non_local_return = true
229+
#Rails.application.config.active_record.commit_transaction_on_non_local_return = true
230230

231231
###
232232
# Controls when to generate a value for <tt>has_secure_token</tt> declarations.
233233
#++
234-
Rails.application.config.active_record.generate_secure_token_on = :initialize
234+
#Rails.application.config.active_record.generate_secure_token_on = :initialize
235235

236236
###
237237
# ** Please read carefully, this must be configured in config/application.rb **
@@ -257,7 +257,7 @@
257257
#
258258
# In previous versions of Rails, Action View always used `Rails::HTML4::Sanitizer` as its vendor.
259259
#++
260-
Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
260+
#Rails.application.config.action_view.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
261261

262262
###
263263
# Configure Action Text to use an HTML5 standards-compliant sanitizer when it is supported on your
@@ -267,13 +267,13 @@
267267
# sanitizers if they are supported, else fall back to HTML4 sanitizers.
268268
#
269269
# In previous versions of Rails, Action Text always used `Rails::HTML4::Sanitizer` as its vendor.
270-
Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
270+
#Rails.application.config.action_text.sanitizer_vendor = Rails::HTML::Sanitizer.best_supported_vendor
271271

272272
###
273273
# Configure the log level used by the DebugExceptions middleware when logging
274274
# uncaught exceptions during requests.
275275
#++
276-
Rails.application.config.action_dispatch.debug_exception_log_level = :error
276+
#Rails.application.config.action_dispatch.debug_exception_log_level = :error
277277

278278
###
279279
# Configure the test helpers in Action View, Action Dispatch, and rails-dom-testing to use HTML5
@@ -283,4 +283,4 @@
283283
#
284284
# In previous versions of Rails, these test helpers always used an HTML4 parser.
285285
#++
286-
Rails.application.config.dom_testing_default_html_version = :html5
286+
#Rails.application.config.dom_testing_default_html_version = :html5

0 commit comments

Comments
 (0)