mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
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`.
This commit is contained in:
parent
25c6f4c947
commit
4e63ce53fc
3 changed files with 7 additions and 16 deletions
|
@ -1,4 +1,4 @@
|
|||
* Deprecate `.halt_and_display_warning_on_return_false`.
|
||||
* Deprecate `.halt_callback_chains_on_return_false`.
|
||||
|
||||
*Rafael Mendonça França*
|
||||
|
||||
|
|
|
@ -80,11 +80,15 @@ module ActiveSupport
|
|||
cattr_accessor :test_order # :nodoc:
|
||||
|
||||
def self.halt_callback_chains_on_return_false
|
||||
Callbacks.halt_and_display_warning_on_return_false
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
ActiveSupport.halt_callback_chains_on_return_false is deprecated and will be removed in Rails 5.2.
|
||||
MSG
|
||||
end
|
||||
|
||||
def self.halt_callback_chains_on_return_false=(value)
|
||||
Callbacks.halt_and_display_warning_on_return_false = value
|
||||
ActiveSupport::Deprecation.warn(<<-MSG.squish)
|
||||
ActiveSupport.halt_callback_chains_on_return_false= is deprecated and will be removed in Rails 5.2.
|
||||
MSG
|
||||
end
|
||||
|
||||
def self.to_time_preserves_timezone
|
||||
|
|
|
@ -69,19 +69,6 @@ module ActiveSupport
|
|||
|
||||
CALLBACK_FILTER_TYPES = [:before, :after, :around]
|
||||
|
||||
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.
|
||||
#
|
||||
# Calls the before and around callbacks in the order they were set, yields
|
||||
|
|
Loading…
Reference in a new issue