Skip to content

Instantly share code, notes, and snippets.

@hayksaakian
Last active August 29, 2015 14:05
Show Gist options
  • Save hayksaakian/9a8391f69b4af54fe763 to your computer and use it in GitHub Desktop.
Save hayksaakian/9a8391f69b4af54fe763 to your computer and use it in GitHub Desktop.
how to force id lookup for delayed job methods
class Post
## Delayed Job Macro
def self.queue(method_name, id, *method_args)
self.find(id).send(method_name, *method_args)
end
def queue(method_name, *method_args)
self.class.delay.queue(method_name, self.id, *method_args)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment