I’m building an app at the moment where specific items can be added to
an order and then purchased through paypal.
Becuase the items are limited, it’s important to relist them quickly
if the order is not completed within 5mins.
Anybody have any suggestions as to how I could go about this?
I was thinking of creating an observer for orders and including an
after_create like so:
Class OrderObserver < ActiveRecord::Observer
sleep 300 # sleep for 5 mins
if self.status > 3 # anything above 3 should be saved
self.items.each do |item|
item.update_attribute :order_id, nil
Is there a better or a standard way of doing this though?