I have recently upgraded from Rails 4.2 to 5.0.6 . I know about the change in callback halting using throw(:abort) instead of returning false. My problem is that I can't make the deprecation warnings go away.
DEPRECATION WARNING: Returning false in Active Record and Active Model callbacks will not implicitly halt a callback chain in Rails 5.1. To explicitly halt the callback chain, please use throw :abort instead.
I have made config/initializers/callback_terminator.rb file with following code
ActiveSupport.halt_callback_chains_on_return_false = false
Is there something I am missing?
I have tinkered with the problem. When I do add the config in config.after_initialize block it works.
config.after_initialize do
ActiveSupport.halt_callback_chains_on_return_false = false
end
But it still doesn't work if I put it in an initializer file. Problem solved for me though.