Skip to content

Commit 542d3f1

Browse files
Improve use_big_decimal_serializer documentation
Follow-up to rails#45618. This fixes a few typos and clarifies the wording.
1 parent 9f1b632 commit 542d3f1

File tree

2 files changed

+23
-16
lines changed

2 files changed

+23
-16
lines changed

guides/source/configuring.md

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2258,14 +2258,21 @@ an `around_perform`. The default value is `true`.
22582258

22592259
#### `config.active_job.use_big_decimal_serializer`
22602260

2261-
Enable the use of BigDecimalSerializer instead of legacy BigDecimal argument
2262-
serialization, which may result in the argument being lossfully converted to
2263-
a String when using certain queue adapters.
2264-
This setting is disabled by default to allow race condition free deployment
2265-
of applications with multiple replicas, in which an old replica would not
2266-
support BigDecimalSerializer..
2267-
In such environments, it should be safe to enable this setting following
2268-
successful deployment of Rails 7.1 which introduces BigDecimalSerializer.
2261+
Enables the new `BigDecimal` argument serializer, which guarantees
2262+
roundtripping. Without this serializer, some queue adapters may serialize
2263+
`BigDecimal` arguments as simple (non-roundtrippable) strings.
2264+
2265+
WARNING: When deploying an application with multiple replicas, old (pre-Rails
2266+
7.1) replicas will not be able to deserialize `BigDecimal` arguments from this
2267+
serializer. Therefore, this setting should only be enabled after all replicas
2268+
have been successfully upgraded to Rails 7.1.
2269+
2270+
The default value depends on the `config.load_defaults` target version:
2271+
2272+
| Starting with version | The default value is |
2273+
| --------------------- | -------------------- |
2274+
| (original) | `false` |
2275+
| 7.1 | `true` |
22692276

22702277
### Configuring Action Cable
22712278

railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults_7_1.rb.tt

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,12 @@
4848
# Disable deprecated singular associations names
4949
# Rails.application.config.active_record.allow_deprecated_singular_associations_name = false
5050

51-
# Enable the use of BigDecimalSerializer instead of legacy BigDecimal argument
52-
# serialization, which may result in the argument being lossfully converted to
53-
# a String when using certain queue adapters.
54-
# This setting is disabled by default to allow race condition free deployment
55-
# of applications with multiple replicas, in which an old replica would not
56-
# support BigDecimalSerializer..
57-
# In such environments, it should be safe to enable this setting following
58-
# successful deployment of Rails 7.1 which introduces BigDecimalSerializer.
51+
# Enable the Active Job `BigDecimal` argument serializer, which guarantees
52+
# roundtripping. Without this serializer, some queue adapters may serialize
53+
# `BigDecimal` arguments as simple (non-roundtrippable) strings.
54+
#
55+
# When deploying an application with multiple replicas, old (pre-Rails 7.1)
56+
# replicas will not be able to deserialize `BigDecimal` arguments from this
57+
# serializer. Therefore, this setting should only be enabled after all replicas
58+
# have been successfully upgraded to Rails 7.1.
5959
# Rails.application.config.active_job.use_big_decimal_serializer = true

0 commit comments

Comments
 (0)