Quantcast
Channel: Active questions tagged redis+ruby-on-rails - Stack Overflow
Viewing all articles
Browse latest Browse all 873

Pass newly created object to after_create callback in Rails

$
0
0

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?


Viewing all articles
Browse latest Browse all 873

Trending Articles