Fix Rails 4 deprecations