pluginaweek / state_machine

Adds support for creating state machines for attributes on any Ruby class
http://www.pluginaweek.org
MIT License
3.74k stars 507 forks source link

Support for Rail 4.1.0(-beta) AR enums #302

Open christhekeele opened 10 years ago

christhekeele commented 10 years ago

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:

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.

mknapik commented 9 years ago

I used aasm because it works with AR enum. However, I like state_machine API more so it'd be nice to have this feature.

Is this feature in the roadmap?