Skip to content

Commit 4e63ce5

Browse files
committed
deprecate halt_callback_chains_on_return_false instead of halt_and_display_warning_on_return_false
`halt_and_display_warning_on_return_false` is not a public API and application is using `halt_callback_chains_on_return_false`. https://github.com/rails/rails/blob/5-0-stable/railties/lib/rails/generators/rails/app/templates/config/initializers/new_framework_defaults.rb.tt#L29 https://github.com/rails/rails/blob/5-0-stable/activesupport/lib/active_support.rb#L86..L88 Therefore, deprecate messages should be issued for `halt_callback_chains_on_return_false` instead of `halt_and_display_warning_on_return_false`.
1 parent 25c6f4c commit 4e63ce5

File tree

3 files changed

+7
-16
lines changed

3 files changed

+7
-16
lines changed

activesupport/CHANGELOG.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
* Deprecate `.halt_and_display_warning_on_return_false`.
1+
* Deprecate `.halt_callback_chains_on_return_false`.
22

33
*Rafael Mendonça França*
44

activesupport/lib/active_support.rb

+6-2
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,15 @@ def self.eager_load!
8080
cattr_accessor :test_order # :nodoc:
8181

8282
def self.halt_callback_chains_on_return_false
83-
Callbacks.halt_and_display_warning_on_return_false
83+
ActiveSupport::Deprecation.warn(<<-MSG.squish)
84+
ActiveSupport.halt_callback_chains_on_return_false is deprecated and will be removed in Rails 5.2.
85+
MSG
8486
end
8587

8688
def self.halt_callback_chains_on_return_false=(value)
87-
Callbacks.halt_and_display_warning_on_return_false = value
89+
ActiveSupport::Deprecation.warn(<<-MSG.squish)
90+
ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2.
91+
MSG
8892
end
8993

9094
def self.to_time_preserves_timezone

activesupport/lib/active_support/callbacks.rb

-13
Original file line numberDiff line numberDiff line change
@@ -69,19 +69,6 @@ module Callbacks
6969

7070
CALLBACK_FILTER_TYPES = [:before, :after, :around]
7171

72-
def self.halt_and_display_warning_on_return_false=(value)
73-
74-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
75-
.halt_and_display_warning_on_return_false= is deprecated and will be removed in Rails 5.2.
76-
MSG
77-
end
78-
79-
def self.halt_and_display_warning_on_return_false
80-
ActiveSupport::Deprecation.warn(<<-MSG.squish)
81-
.halt_and_display_warning_on_return_false is deprecated and will be removed in Rails 5.2.
82-
MSG
83-
end
84-
8572
# Runs the callbacks for the given event.
8673
#
8774
# Calls the before and around callbacks in the order they were set, yields

0 commit comments

Comments
 (0)