fix deprecations for rails 4