I need to update a model after delayed_job
processes a task on it, e.g:
foo.delay.something
After something
is done, I need to update the foo object, what is the best way to achieve this? I was thinking in coding a callback on the Delayed::Backend::ActiveRecord::Job
class, but there's should be something cleaner and better to do this.
I would just updated it at the end of the #foo method:
def foo
# do work here
update_attribute :processed, true
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With