class MyModel < ActiveRecord::Base
state_machine :status, initial: :initial do
event :order_purchased do
transition [:initial, :ordered] => :ordered
end
state :initial
state :ordered
end
end
I want to implicitly trigger the order_purchased event and update other attributes at the same time. When using state_machine this worked like so:
I have some ActveRecord based model like this:
I want to implicitly trigger the order_purchased event and update other attributes at the same time. When using state_machine this worked like so:
With state_machines, however, I get an error:
Also trying something like given in the README of state_machines (copied from state_machine) like the following:
Does yield