slagyr / statemachine

Ruby Library for statemachines
http://slagyr.github.com/statemachine
Other
41 stars 9 forks source link

Introduce on_state_change for building persistent states. #13

Closed godfat closed 10 years ago

godfat commented 10 years ago

I am trying to migrate from AASM to statemachine, and I need someway to make statemachine update the state in the database, i.e. the aasm_state column.

At first I tried on_entry callback, but it's tedious to apply to every states. Using on_entry on superstate didn't seem to fit, either. Introducing this callback might be much easier to do this...

Thank you for considering!

slagyr commented 10 years ago

Released in version 2.3.0. This probably requires update to docs.... I'll have to take care of that.

godfat commented 10 years ago

That would be awesome, thank you!