rails/guides
Sam Bostock bc1f323338
Add ActiveJob::Serializers::BigDecimalSerializer
Previously, BigDecimal was listed as not needing a serializer.  However,
when used with an adapter storing the job arguments as JSON, it would get
serialized as a simple String, resulting in deserialization also producing
a String (instead of a BigDecimal).

By using a serializer, we ensure the round trip is safe.

During upgrade deployments of applications with multiple replicas making use of
BigDecimal job arguments with a queue adapter serializing to JSON, there exists
a possible race condition, whereby a "new" replica enqueues a job with an
argument serialized using `BigDecimalSerializer`, and an "old" replica fails to
deserialize it (as it does not have `BigDecimalSerializer`).

Therefore, to ensure safe upgrades, serialization will not use
`BigDecimalSerializer` until `config.active_job.use_big_decimal_serializer` is
enabled, which can be done safely after successful deployment of Rails 7.1.

This option will be removed in Rails 7.2, when it will become the default.
2022-07-19 15:31:41 -04:00
..
assets Unify LTR / RTL CSS for guides 2022-06-22 16:42:48 -05:00
bug_report_templates No need to check for Ruby version on the bug reports template anymore 2022-01-06 20:50:33 +00:00
rails_guides Unify LTR / RTL CSS for guides 2022-06-22 16:42:48 -05:00
source Add ActiveJob::Serializers::BigDecimalSerializer 2022-07-19 15:31:41 -04:00
.document
CHANGELOG.md Start Rails 7.1 development 2021-12-07 15:52:30 +00:00
Rakefile Run the gem template guides for 3.1 now that 7.0.1 is out 2022-01-06 21:56:06 +00:00
rails_guides.rb Use safe nav operator when calling RailsGuides::Generator.new 2018-12-05 12:41:07 +09:00
w3c_validator.rb Use frozen string literal in guides/ 2017-08-13 22:04:09 +09:00