There are two parts to my problem.
- how can i define nil as the initial state of any state machine?
- how can i transition any state to nil?
if we do something like this then it saves "nil" as value not NULL,
aasm(:aasm_state, column: :status) do
state :nil, initial: true
state :state1, :state2, :state3, :state4
event :change_state do
transitions from: :state1, to: :state2
end
end
how can i modify below code to do both or either of the above mentioned things?
aasm(:aasm_state, column: :status) do
state :state1, :state2, :state3, :state4
event :change_state do
transitions from: :state1, to: :state2
end
end