Deprecate halt_and_display_warning_on_return_false

上级 3a25cdca
* Deprecate `.halt_and_display_warning_on_return_false`.
*Rafael Mendonça França*
* Remove deprecated behavior that halts callbacks when the return is false.
*Rafael Mendonça França*
......
......@@ -69,11 +69,18 @@ module Callbacks
CALLBACK_FILTER_TYPES = [:before, :after, :around]
# If true, Active Record and Active Model callbacks returning +false+ will
# halt the entire callback chain and display a deprecation message.
# If false, callback chains will only be halted by calling +throw :abort+.
# Defaults to +true+.
mattr_accessor(:halt_and_display_warning_on_return_false, instance_writer: false) { true }
def self.halt_and_display_warning_on_return_false=(value)
ActiveSupport::Deprecation.warn(<<-MSG.squish)
.halt_and_display_warning_on_return_false= is deprecated and will be removed in Rails 5.2.
MSG
end
def self.halt_and_display_warning_on_return_false
ActiveSupport::Deprecation.warn(<<-MSG.squish)
.halt_and_display_warning_on_return_false is deprecated and will be removed in Rails 5.2.
MSG
end
# Runs the callbacks for the given event.
#
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册