port to rails4