Fix deprecations for Rails 4.0.