fix rails 4 deprecation