我正在使用aasm状态机。我有以下事件。这样做是将状态从 更改order_created
为payment_response_received
。所以在改变这个之后我想调用一个方法verify_payment_response(data)
。我可以通过调用来改变这种状态@booking.move_to_payment_response_received!
,但是如何传递参数以在 after 回调中使用?
event :move_to_payment_response_received do
after_commit do
self.verify_payment_response(data) #How can I pass this data param from my controller
end
transitions from: :order_created, to: :payment_response_received
end