2023-07-02 10:33:59 +00:00
|
|
|
* All tests now respect the `active_job.queue_adapter` config
|
|
|
|
|
|
|
|
Previously if you had set `config.active_job.queue_adapter` in your `config/application.rb`
|
|
|
|
or `config/environments/test.rb` file, the adapter you selected was previously not used consistently
|
|
|
|
across all tests. In some tests your adapter would be used, but other tests would use the `TestAdapter`.
|
|
|
|
|
|
|
|
In Rails 7.2, all tests will respect the `queue_adapter` config if provided. If no config is provided,
|
|
|
|
the `TestAdapter` will continue to be used.
|
|
|
|
|
|
|
|
See [#48585](https://github.com/rails/rails/pull/48585) for more details.
|
|
|
|
|
|
|
|
*Alex Ghiculescu*
|
|
|
|
|
2024-03-27 11:38:49 +00:00
|
|
|
* Make Active Job transaction aware when used conjointly with Active Record.
|
|
|
|
|
|
|
|
A common mistake with Active Job is to enqueue jobs from inside a transaction,
|
|
|
|
causing them to potentially be picked and ran by another process, before the
|
2024-04-08 17:48:44 +00:00
|
|
|
transaction is committed, which may result in various errors.
|
2024-03-27 11:38:49 +00:00
|
|
|
|
|
|
|
```ruby
|
|
|
|
Topic.transaction do
|
|
|
|
topic = Topic.create(...)
|
|
|
|
NewTopicNotificationJob.perform_later(topic)
|
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
Now Active Job will automatically defer the enqueuing to after the transaction is committed,
|
|
|
|
and drop the job if the transaction is rolled back.
|
|
|
|
|
2024-04-05 19:25:13 +00:00
|
|
|
Various queue implementations can choose to disable this behavior, and users can disable it,
|
2024-03-27 11:38:49 +00:00
|
|
|
or force it on a per job basis:
|
|
|
|
|
|
|
|
```ruby
|
|
|
|
class NewTopicNotificationJob < ApplicationJob
|
2024-04-05 19:25:13 +00:00
|
|
|
self.enqueue_after_transaction_commit = :never # or `:always` or `:default`
|
2024-03-27 11:38:49 +00:00
|
|
|
end
|
|
|
|
```
|
|
|
|
|
|
|
|
*Jean Boussier*, *Cristian Bica*
|
|
|
|
|
2024-01-11 18:34:31 +00:00
|
|
|
* Do not trigger immediate loading of `ActiveJob::Base` when loading `ActiveJob::TestHelper`.
|
|
|
|
|
|
|
|
*Maxime Réty*
|
|
|
|
|
2023-12-02 05:54:14 +00:00
|
|
|
* Preserve the serialized timezone when deserializing `ActiveSupport::TimeWithZone` arguments.
|
|
|
|
|
|
|
|
*Joshua Young*
|
|
|
|
|
2023-10-12 19:26:25 +00:00
|
|
|
* Remove deprecated `:exponentially_longer` value for the `:wait` in `retry_on`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2023-10-12 19:18:21 +00:00
|
|
|
* Remove deprecated support to set numeric values to `scheduled_at` attribute.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
2023-10-12 19:07:33 +00:00
|
|
|
* Deprecate `Rails.application.config.active_job.use_big_decimal_serialize`.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
|
|
|
|
|
|
|
* Remove deprecated primitive serializer for `BigDecimal` arguments.
|
|
|
|
|
|
|
|
*Rafael Mendonça França*
|
2023-09-27 03:08:31 +00:00
|
|
|
|
2023-09-27 03:59:11 +00:00
|
|
|
Please check [7-1-stable](https://github.com/rails/rails/blob/7-1-stable/activejob/CHANGELOG.md) for previous changes.
|