From 4e5f5b67b0de8edacecff0ca138e4185f0cba732 Mon Sep 17 00:00:00 2001 From: Alan Guo Xiang Tan Date: Fri, 6 May 2022 10:33:42 +0800 Subject: [PATCH] DEV: Remove monkey patch that is no longer required (#16648) --- lib/search/grouped_search_results.rb | 21 --------------------- 1 file changed, 21 deletions(-) diff --git a/lib/search/grouped_search_results.rb b/lib/search/grouped_search_results.rb index 01ec0a62c2a..9c3003dc30e 100644 --- a/lib/search/grouped_search_results.rb +++ b/lib/search/grouped_search_results.rb @@ -9,27 +9,6 @@ class Search class TextHelper extend ActionView::Helpers::TextHelper - - private - - # TODO: Remove when https://github.com/rails/rails/pull/39979 is merged - # For a 10_000 words string, speeds up excerpts by 85X. - def self.cut_excerpt_part(part_position, part, separator, options) - return "", "" unless part - - radius = options.fetch(:radius, 100) - omission = options.fetch(:omission, "...") - - if separator != "" - part = part.split(separator) - part.delete("") - end - - affix = part.length > radius ? omission : "" - part = part.public_send(part_position == :first ? :last : :first, radius) - part = part.join(separator) if separator != "" - [affix, part] - end end attr_reader(