fix deprecation for rails 4