1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00
rails--rails/activejob/test/support
Johannes Opper 3860e6b2bf Fixes #20799
When `#perform_later` is called the locale isn't stored on the
queue, which results in a locale reset when the job is performed.

An example of the problem:

    I18n.locale = 'de'
    HelloJob.perform_now # german message, correct

but

    I18n.locale = 'de'
    HelloJob.perform_later # english message, incorrect

This PR attaches the current I18n.locale to every job during the
serialization process. It is then restored during deserialization
and used to perform the job with the correct locale.

It falls back to the default locale if no serialized locale is
found in order to provide backward compatibility with previously
stored jobs. It is not necessary to clear the queue for the update.
2015-08-04 00:38:18 +02:00
..
backburner Add 'activejob/' from commit '14f74a8331f94150dfee653224de8fc837797709' 2014-08-12 09:17:19 +00:00
delayed_job/delayed Pass symbol as an argument instead of a block 2014-11-29 11:53:24 +01:00
integration Fixes #20799 2015-08-04 00:38:18 +02:00
que Stop using Que's named queues in its ActiveJob adapter. 2015-03-24 09:25:49 -04:00
queue_classic ActiveJob: Implemented enqueue_at for QueueClassic 2014-09-02 14:35:53 +03:00
sneakers Add 'activejob/' from commit '14f74a8331f94150dfee653224de8fc837797709' 2014-08-12 09:17:19 +00:00
job_buffer.rb [ActiveJob] extract JobBuffer from helper 2014-08-29 08:50:09 +00:00