Revert "Remove deprecated `children` and `parent_of?` on ActiveSupport::Notifications::Event"

This reverts commit 29679df058.

This method was deprecated in 7.1, so shouldn't be removed until 7.2.
This commit is contained in:
Rafael Mendonça França 2023-03-03 22:38:21 +00:00
parent 53a47a9890
commit fee2bf3f80
No known key found for this signature in database
GPG Key ID: FC23B6D0F1EEE948
3 changed files with 17 additions and 6 deletions

View File

@ -7,10 +7,6 @@
*Rafael Mendonça França*
* Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
*Rafael Mendonça França*
* Remove implicit conversion of objects into `String` by `ActiveSupport::SafeBuffer`.
*Rafael Mendonça França*

View File

@ -165,6 +165,23 @@ module ActiveSupport
@allocation_count_finish - @allocation_count_start
end
def children # :nodoc:
ActiveSupport.deprecator.warn <<~EOM
ActiveSupport::Notifications::Event#children is deprecated and will
be removed in Rails 7.2.
EOM
[]
end
def parent_of?(event) # :nodoc:
ActiveSupport.deprecator.warn <<~EOM
ActiveSupport::Notifications::Event#parent_of? is deprecated and will
be removed in Rails 7.2.
EOM
start = (time - event.time) * 1000
start <= 0 && (start + duration >= event.duration)
end
# Returns the difference in milliseconds between when the execution of the
# event started and when it ended.
#

View File

@ -166,8 +166,6 @@ Please refer to the [Changelog][active-support] for detailed changes.
* Remove implicit conversion of objects into `String` by `ActiveSupport::SafeBuffer`.
* Remove deprecated `ActiveSupport::Notifications::Event#children` and `ActiveSupport::Notifications::Event#parent_of?`.
* Remove deprecated support to generate incorrect RFC 4122 UUIDs when providing a namespace ID that is not one of the
constants defined on `Digest::UUID`.