When running my functional tests, I'm getting the following warning in one of the test cases but I can't pinpoint where it's coming from:
gems/actionpack-2.3.8/lib/action_controller/record_identifier.rb:76: warning: Object#id will be deprecated; use Object#object_id
Unfortunately that's the only line of the backtrace that's shown, even if I run it with rake test --trace
, and there is no more information in log/test.log
.
How can I get the full backtrace for this warning or otherwise figure out which line in my code is causing it?
Deprecation warnings are a common thing in our industry. They are warnings that notify us that a specific feature (e.g. a method) will be removed soon (usually in the next minor or major version) and should be replaced with something else.
Then the only way so remove them all is to: Add $VERBOSE = nil to config/environments/test. rb. Run guard with: RUBYOPT='-W0' bundle exec guard.
On 26 March 2019, the deprecation period for Ruby Sass will end and it will no longer be maintained.
To solve this you could enable the full debugging information. (see the help)
ActiveSupport::Deprecation.debug = true
As @Eric Anderson says it should be placed after Rails loads (i.e. after require 'rails/all'
in application.rb) but before bundler runs to catch deprecation warning in gems (i.e. before Bundler.require(:default, Rails.env) if defined?(Bundler)
in application.rb).
You can add a condition, like if ENV["DEBUG"]
or if environment == :test
to leave this in your config.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With