diff options
author | David Heinemeier Hansson <david@loudthinking.com> | 2017-03-15 17:46:28 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-15 17:46:28 +0100 |
commit | 85c2b7565f37351c3d6091eab2a4b966a2f1c8e5 (patch) | |
tree | 0115b5fe0a0f09158393cc4167335593990f3b3e /activejob/lib/active_job | |
parent | e7a90bd8d1d5dddf8abcd00badadb4ce12eab7c2 (diff) | |
download | rails-85c2b7565f37351c3d6091eab2a4b966a2f1c8e5.tar.gz rails-85c2b7565f37351c3d6091eab2a4b966a2f1c8e5.tar.bz2 rails-85c2b7565f37351c3d6091eab2a4b966a2f1c8e5.zip |
Revert #27850 following test breakage (#28427)
Diffstat (limited to 'activejob/lib/active_job')
-rw-r--r-- | activejob/lib/active_job/queue_adapters/test_adapter.rb | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/activejob/lib/active_job/queue_adapters/test_adapter.rb b/activejob/lib/active_job/queue_adapters/test_adapter.rb index ec825f12cd..1b633b210e 100644 --- a/activejob/lib/active_job/queue_adapters/test_adapter.rb +++ b/activejob/lib/active_job/queue_adapters/test_adapter.rb @@ -24,27 +24,30 @@ module ActiveJob end def enqueue(job) #:nodoc: + return if filtered?(job) + job_data = job_to_hash(job) enqueue_or_perform(perform_enqueued_jobs, job, job_data) end def enqueue_at(job, timestamp) #:nodoc: + return if filtered?(job) + job_data = job_to_hash(job, at: timestamp) enqueue_or_perform(perform_enqueued_at_jobs, job, job_data) end private - def job_to_hash(job, extras = {}) { job: job.class, args: job.serialize.fetch("arguments"), queue: job.queue_name }.merge!(extras) end def enqueue_or_perform(perform, job, job_data) - if !perform || filtered?(job) - enqueued_jobs << job_data - else + if perform performed_jobs << job_data Base.execute job.serialize + else + enqueued_jobs << job_data end end |