fix rails4 deprecation