Skip to content

Instantly share code, notes, and snippets.

@brenes
Created April 24, 2012 10:57
Show Gist options
  • Select an option

  • Save brenes/2478771 to your computer and use it in GitHub Desktop.

Select an option

Save brenes/2478771 to your computer and use it in GitHub Desktop.
Disabling delayed jobs
# 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