diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 08:44:21 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2012-07-03 08:44:21 -0700 |
commit | a967487cbd7760a7108edd2328b18c137edc1d6d (patch) | |
tree | 5763b7ab0d048f831a09ca9cce90c76aec2dce3e /railties/lib | |
parent | eedca4a1467927fce520f567350be0c4b49b9a6f (diff) | |
parent | b44104ae1357f0177056e833d7cd1e0abaa5c759 (diff) | |
download | rails-a967487cbd7760a7108edd2328b18c137edc1d6d.tar.gz rails-a967487cbd7760a7108edd2328b18c137edc1d6d.tar.bz2 rails-a967487cbd7760a7108edd2328b18c137edc1d6d.zip |
Merge pull request #6946 from threedaymonk/queue-refs
Ensure that queued jobs are marshallable
Diffstat (limited to 'railties/lib')
-rw-r--r-- | railties/lib/rails/queueing.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/railties/lib/rails/queueing.rb b/railties/lib/rails/queueing.rb index b4bc7fcd18..8a76914548 100644 --- a/railties/lib/rails/queueing.rb +++ b/railties/lib/rails/queueing.rb @@ -22,6 +22,13 @@ module Rails @que.dup end + # Marshal and unmarshal job before pushing it onto the queue. This will + # raise an exception on any attempts in tests to push jobs that can't (or + # shouldn't) be marshalled. + def push(job) + super Marshal.load(Marshal.dump(job)) + end + # Drain the queue, running all jobs in a different thread. This method # may not be available on production queues. def drain |