fix deprecation warning under rails4