diff options
author | utilum <oz@utilum.com> | 2016-09-22 17:17:28 +0200 |
---|---|---|
committer | utilum <oz@utilum.com> | 2017-06-27 07:08:55 +0200 |
commit | b58d73fc5771338a10fcdac7beea577b7a23ea78 (patch) | |
tree | 29d9052d339d0528da859ac32997b7b075034510 | |
parent | 61cc630ac7e7f8554dc049a3e5a2509c00303ef8 (diff) | |
download | rails-b58d73fc5771338a10fcdac7beea577b7a23ea78.tar.gz rails-b58d73fc5771338a10fcdac7beea577b7a23ea78.tar.bz2 rails-b58d73fc5771338a10fcdac7beea577b7a23ea78.zip |
ActiveJob::Core#serialize stores provider_job_id (fixes #26581).
-rw-r--r-- | activejob/lib/active_job/core.rb | 1 | ||||
-rw-r--r-- | activejob/test/cases/job_serialization_test.rb | 8 |
2 files changed, 9 insertions, 0 deletions
diff --git a/activejob/lib/active_job/core.rb b/activejob/lib/active_job/core.rb index 548ec89ee2..e3e63f227e 100644 --- a/activejob/lib/active_job/core.rb +++ b/activejob/lib/active_job/core.rb @@ -80,6 +80,7 @@ module ActiveJob { "job_class" => self.class.name, "job_id" => job_id, + "provider_job_id" => provider_job_id, "queue_name" => queue_name, "priority" => priority, "arguments" => serialize_arguments(arguments), diff --git a/activejob/test/cases/job_serialization_test.rb b/activejob/test/cases/job_serialization_test.rb index 3f2e300dfa..c737557ece 100644 --- a/activejob/test/cases/job_serialization_test.rb +++ b/activejob/test/cases/job_serialization_test.rb @@ -44,4 +44,12 @@ class JobSerializationTest < ActiveSupport::TestCase job.deserialize({}) assert_equal "en", job.locale end + + test "serialize stores provider_job_id" do + job = HelloJob.new + assert_nil job.serialize["provider_job_id"] + + job.provider_job_id = "some value set by adapter" + assert_equal job.provider_job_id, job.serialize["provider_job_id"] + end end |