fix state machine on rails4