rails4 compatibility and update