無法理解通過我收到此錯誤StateMachine :: InvalidTransition:無法通過transition_details_not_found從新:(原因(S) :國家不能通過「找不到退款詳情」)過渡無法從新狀態過渡 - 等待退款詳細信息狀態Rails Statemachine Gem --- Pluginaweek
state_machine :initial => :new do
event :all_products_received do
transition [:new, :pending_refund_details, :canceled] => :pending_payment
end
event :refund_details_not_found do
transition :new => :pending_refund_details
end
event :order_return_canceled do
transition :new => :canceled
end
event :mistaked_canceled do
transition :canceled => :buyer_dispatched
end
event :payment_made do
transition :pending_payment => :payment_complete
end
before_transition :to => :canceled do |return1|
return1.total = 0
end
before_transition :to => :pending_payment do |return1|
return1.pending_on = Time.now
end
before_transition :to => :payment_complete do |return1|
return1.completed_on = Time.now
end
end
我打電話之前的過渡保存
只是把它清除掉,你正在做'object.refund_details_not_found'和得到那個錯誤? – amencarini
@amencarini是的 – chirag7jain