Fixed deprecations for Rails 4.2