compatible for rails4