Created
April 24, 2012 10:57
-
-
Save brenes/2478771 to your computer and use it in GitHub Desktop.
Disabling delayed jobs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # DelayedJob in its latest version allows to disable job delaying by a simple Delayed::Worker.delay_jobs = false. | |
| # If we're using a previous version (i.e. the branch compatible with Rails 2), we need to open Delayed proxy class and force it to perform the works | |
| # This way, in testing we can test mail delivieries and others | |
| module Delayed | |
| module MessageSending | |
| def send_later(method, *args) | |
| Delayed::PerformableMethod.new(self, method.to_sym, args).perform | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment