diff --git a/activesupport/CHANGELOG.md b/activesupport/CHANGELOG.md index f563cdb2234c..5b5c67b1f9c1 100644 --- a/activesupport/CHANGELOG.md +++ b/activesupport/CHANGELOG.md @@ -1,3 +1,7 @@ +* Remove deprecated `SafeBuffer#clone_empty`. + + *Rafael Mendonça França* + * Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`. *Rafael Mendonça França* diff --git a/activesupport/lib/active_support/core_ext/string/output_safety.rb b/activesupport/lib/active_support/core_ext/string/output_safety.rb index e7008021ecb2..8e44c045402c 100644 --- a/activesupport/lib/active_support/core_ext/string/output_safety.rb +++ b/activesupport/lib/active_support/core_ext/string/output_safety.rb @@ -77,13 +77,6 @@ def initialize_copy(other) @html_safe = other.html_safe? end - def clone_empty # :nodoc: - ActiveSupport.deprecator.warn <<~EOM - ActiveSupport::SafeBuffer#clone_empty is deprecated and will be removed in Rails 7.2. - EOM - self[0, 0] - end - def concat(value) unless value.nil? super(implicit_html_escape_interpolated_argument(value)) diff --git a/activesupport/test/safe_buffer_test.rb b/activesupport/test/safe_buffer_test.rb index 14353c672bde..5e610d40802f 100644 --- a/activesupport/test/safe_buffer_test.rb +++ b/activesupport/test/safe_buffer_test.rb @@ -195,21 +195,6 @@ def test_titleize assert_kind_of NilClass, @buffer.slice("chipchop") end - test "clone_empty returns an empty buffer" do - assert_deprecated(ActiveSupport.deprecator) do - assert_equal "", ActiveSupport::SafeBuffer.new("foo").clone_empty - end - end - - test "clone_empty keeps the original dirtiness" do - assert_deprecated(ActiveSupport.deprecator) do - assert_predicate @buffer.clone_empty, :html_safe? - end - assert_deprecated(ActiveSupport.deprecator) do - assert_not_predicate @buffer.gsub!("", "").clone_empty, :html_safe? - end - end - test "Should be safe when sliced if original value was safe" do new_buffer = @buffer[0, 0] assert_not_nil new_buffer diff --git a/guides/source/7_2_release_notes.md b/guides/source/7_2_release_notes.md index 568a3aa4465b..dd06674ab556 100644 --- a/guides/source/7_2_release_notes.md +++ b/guides/source/7_2_release_notes.md @@ -207,6 +207,8 @@ Please refer to the [Changelog][active-support] for detailed changes. ### Removals +* Remove deprecated `SafeBuffer#clone_empty`. + * Remove deprecated `#to_default_s` from `Array`, `Date`, `DateTime` and `Time`. * Remove deprecated `:pool_size` and `:pool_timeout` options for the cache storage.