I have a model that represents a registration process, which needs to track the progression of several processes (background checks, interviews, information collection...). Each one can be represented by a state machine, and then the overall state of the registration might depend on the state of the others.
Can aasm handle this? Any other ideas or design considerations?
Since this question comes up when you google multiple state machines in one model, it would be good to have an answer, although there is already an answer. Please try doing:
class Example < ActiveRecord::Base
include AASM
aasm :search, :column => :search do
state :initialised, :initial => true
...
end
aasm :sync, :column => :sync do
state :unsynced, :initial => true
...
end
end
This will create two state machines based on two columns, search and sync.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With