mongoid/mongoid — Issue #1605: Deprecation warning in rails 3.2, with potential fix
Author: johanlindblad
Created: 2012-01-18 02:49:47+00:00
State: open

Rails 3.2 rc1 gives the following message when using mongoid:

DEPRECATION WARNING: ActionDispatch::ShowExceptions.rescue_responses is deprecated. Please configure your
exceptions using a railtie or in your application config instead. (called from at
/Users/*snip*/config/environment.rb:5)"

It is shown when, for example, running rspec and makes the test output less clean than it would normally be. The line it points at is just `Application.initialize!` and since it's just a warning rather than an exception no stack trace is shown. I modified ActionDispatch temporarily to throw an exception and the offending code is `ActionDispatch::ShowExceptions.rescue_responses.update({` in `railtie.rb`.

Modifying that line to `config.action_dispatch.rescue_responses.update({`, which is how ActiveRecord does it, makes the warning go away. With that change all tests still pass and there is no apparent change in behavior so that might be an easy fix, although I wouldn't know if there's a better solution.