state machine

fix state machine on rails4
fixes