What causes deprecation warning: ActiveRecord::Base.raise_in_transactional_callbacks=?
I believe this behaviour was added between 4.1 and 4.2 as a temporary solution to a problem which is no longer relevant in rails 5:
http://edgeguides.rubyonrails.org/upgrading_ruby_on_rails.html#error-handling-in-transaction-callbacks
Currently, Active Record suppresses errors raised within after_rollback or after_commit callbacks and only prints them to the logs. In the next version, these errors will no longer be suppressed. Instead, the errors will propagate normally just like in other Active Record callbacks.
When you define an after_rollback or after_commit callback, you will receive a deprecation warning about this upcoming change. When you are ready, you can opt into the new behavior and remove the deprecation warning by adding following configuration to your config/application.rb:
config.active_record.raise_in_transactional_callbacks = true
For clarification, as @pixelearth suggests my comment below isn't clear/prominent enough. In Rails 5 and later remove the line from config/application.rb
:
config.active_record.raise_in_transactional_callbacks = true
Writing this here for more visbility for @R. Hatherall's comment.
I was getting this warning when upgrading to 5 not becuase I DIDN't have the following setting in application.rb, but because I DID.
In rails 5 remove the following line from application.rb
config.active_record.raise_in_transactional_callbacks = true