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/jobs
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
..
callback_job.rb - Inline AJ around_perform and around_enqueue in CallbackJob used for tests. 2014-10-21 11:37:40 +05:30
gid_job.rb [ActiveJob] extract JobBuffer from helper 2014-08-29 08:50:09 +00:00
hello_job.rb [ActiveJob] extract JobBuffer from helper 2014-08-29 08:50:09 +00:00
kwargs_job.rb Allow keyword arguments to work with ActiveJob 2015-01-30 13:43:39 -07:00
logging_job.rb
nested_job.rb Active Job refactoring 2014-09-03 23:01:46 +03:00
rescue_job.rb Active Job refactoring 2014-09-03 23:01:46 +03:00
translated_hello_job.rb Fixes #20799 2015-08-04 00:38:18 +02:00