-
-
Save hayksaakian/9a8391f69b4af54fe763 to your computer and use it in GitHub Desktop.
how to force id lookup for delayed job methods
This file contains 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
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