fix deprecation warning for rails 4