You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This updates the description of several deprecation-related
configuration settings to clarify that their "default" values are from
the default generated `config/environments` files, and that those values
vary by environment. This also updates the description of the
`active_support.deprecation_behavior` initializer to mention the new
`Rails.application.deprecators`, and to link to the relevant
configuration settings.
Copy file name to clipboardExpand all lines: guides/source/configuring.md
+12-4Lines changed: 12 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2031,19 +2031,25 @@ The default value depends on the `config.load_defaults` target version:
2031
2031
2032
2032
#### `config.active_support.deprecation`
2033
2033
2034
-
Configures the behavior of deprecation warnings. The options are `:raise`, `:stderr`, `:log`, `:notify`, or `:silence`. The default is `:stderr`.
2034
+
Configures the behavior of deprecation warnings. The options are `:raise`, `:stderr`, `:log`, `:notify`, and `:silence`.
2035
+
2036
+
In the default generated `config/environments` files, this is set to `:log` for development and `:stderr` for test, and it is omitted for production in favor of [`config.active_support.report_deprecations`](#config-active-support-report-deprecations).
Configures the behavior of disallowed deprecation warnings. The options are `:raise`, `:stderr`, `:log`, `:notify`, or `:silence`. The default is `:raise`.
2040
+
Configures the behavior of disallowed deprecation warnings. The options are `:raise`, `:stderr`, `:log`, `:notify`, and `:silence`.
2041
+
2042
+
In the default generated `config/environments` files, this is set to `:raise` for both development and test, and it is omitted for production in favor of [`config.active_support.report_deprecations`](#config-active-support-report-deprecations).
Configures deprecation warnings that the Application considers disallowed. This allows, for example, specific deprecations to be treated as hard failures.
2043
2047
2044
2048
#### `config.active_support.report_deprecations`
2045
2049
2046
-
Allows you to disable all deprecation warnings (including disallowed deprecations); it makes `ActiveSupport::Deprecation.warn` a no-op. This is enabled by default in production.
2050
+
When `false`, disables all deprecation warnings, including disallowed deprecations, making `ActiveSupport::Deprecation.warn` a no-op.
2051
+
2052
+
In the default generated `config/environments` files, this is set to `false` for production.
@@ -3042,7 +3048,7 @@ Below is a comprehensive list of all the initializers found in Rails in the orde
3042
3048
3043
3049
*`i18n.callbacks`: In the development environment, sets up a `to_prepare` callback which will call `I18n.reload!`if any of the locales have changed since the last request. In production this callback will only run on the first request.
3044
3050
3045
-
*`active_support.deprecation_behavior`: Sets up deprecation reporting forenvironments, defaulting to `:log`for development, `:silence`for production, and`:stderr`fortest. Can be set to an array of values. This initializer also sets up behaviors fordisallowed deprecations, defaulting to `:raise`for development andtestand`:silence`for production. Disalloweddeprecationwarnings default to an empty array.
3051
+
*`active_support.deprecation_behavior`: Sets up deprecation reporting behavior for[`Rails.application.deprecators`][] based on [`config.active_support.report_deprecations`](#config-active-support-report-deprecations), [`config.active_support.deprecation`](#config-active-support-deprecation), [`config.active_support.disallowed_deprecation`](#config-active-support-disallowed-deprecation), and [`config.active_support.disallowed_deprecation_warnings`](#config-active-support-disallowed-deprecation-warnings).
3046
3052
3047
3053
*`active_support.initialize_time_zone`: Sets the default time zone for the application based on the `config.time_zone` setting, which defaults to "UTC".
3048
3054
@@ -3133,6 +3139,8 @@ Below is a comprehensive list of all the initializers found in Rails in the orde
3133
3139
3134
3140
*`disable_dependency_loading`: Disables the automatic dependency loading if the `config.eager_load` is set to `true`.
0 commit comments