before_transition to: [:shipped] do |order, transition|
order.ship_date = Time.now
end
after_transition to: [:shipped, :picked_up] do |order, transition ||vehicle, transition|
puts order.ship_date
order.update_inventory_status!
end
In this example, the ship_date attribute of the order will be nil in the after_transition callback.
In this example, the
ship_date
attribute of the order will benil
in the after_transition callback.