Everytime an object has been created i want to enqueue it in a Redis queue to check for certain properties. How can i add the created object directly as a parameter to the callback? So my redis job would do something like this:
class FurtherProcessCarJob
#....
def self.perform(order)
puts order.id
end
end
whereas in the model
after_create Resque.enqueue FurtherProcessCar, #self
It is possible to hook a method to the callback and there look for the car again and the enqueue the object, but is it possible to do it directly?
after_create { | record | Resque.enqueue record }
should be working as well? see api.rubyonrails.org/classes/ActiveRecord/Callbacks.html first example – Iceboat