Skip to content

Instantly share code, notes, and snippets.

@corny
Created October 8, 2012 18:17
Show Gist options
  • Save corny/3854016 to your computer and use it in GitHub Desktop.
Save corny/3854016 to your computer and use it in GitHub Desktop.
Resque Helpers
module AsyncHelper
extend ActiveSupport::Concern
module ClassMethods
def perform(id, method, *args)
find(id).send(method, *args)
end
end
def async(method, *args)
Resque.enqueue(self.class, id, method, *args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment