I have a rails model called Creative that implements a workflow using the aasm gem. Currently my model has just one workflow implemented in it.
I have a business scenario that will require me to implement another workflow in the same model which which will be activated if a boolean value on the model is true.
I see 2 approaches that could be viable options
- Create a new model that uses the same table name as
Creativeand implement the workflow there - Implement the workflow in the same model using a separate column to store the states for the second workflow and use its method depending on my boolean value
What would be a good design that could be implemented here?
I understand this is a very open ended question and would love to get suggestions if anyone has come across such a scenario
I think something like this should work.
If the boolean value is true the flow will be
else
NOTE: This might get complex if let's say you have 3-4 workflows.
It's ok till you have 2 workflows