Does anyone know if state_machine plays well with the new ActiveRecord enum feature? I was considering upgrading my app sooner than I normally would for it, but I'd want to use it in conjunction with state_machine.
I don't see any reason why it couldn't be made work, since state_machine accepts integer state, but my concerns are:
Loss of 'pretty' references to states as symbols+strings when using the raw integer mapping
Overlapping getter/setter concerns such as state=, state, in_state?, set_state!, etc.
It seems like an alternative StateMachine::Integrations::ActiveRecordEnum could be made to handle this case, and offload a lot of functionality onto it. I don't know. I might poke around the Integration later to see what this would entail, but I thought I'd see if there was any other pioneering work on Enum support.
Does anyone know if state_machine plays well with the new ActiveRecord
enum
feature? I was considering upgrading my app sooner than I normally would for it, but I'd want to use it in conjunction with state_machine.I don't see any reason why it couldn't be made work, since state_machine accepts integer state, but my concerns are:
state=
,state
,in_state?
,set_state!
, etc.It seems like an alternative
StateMachine::Integrations::ActiveRecordEnum
could be made to handle this case, and offload a lot of functionality onto it. I don't know. I might poke around the Integration later to see what this would entail, but I thought I'd see if there was any other pioneering work on Enum support.