diff options
author | Claire <claire.github-309c@sitedethib.com> | 2022-08-25 05:07:39 +0200 |
---|---|---|
committer | Claire <claire.github-309c@sitedethib.com> | 2022-08-25 05:07:39 +0200 |
commit | 2d1d4210f9d394ea8e7357df08f8ca2cc925384a (patch) | |
tree | a5c69693d11b59a673b1981ea2d85bbc17991c42 /app/presenters | |
parent | 5a3d09dc8e30198b4d8d921ef0b1ba0a35fe01d9 (diff) | |
parent | 861b35dd54d266bc0a40b3cacb28e5b82ff6faaa (diff) |
Merge branch 'main' into glitch-soc/merge-upstream
Diffstat (limited to 'app/presenters')
-rw-r--r-- | app/presenters/filter_result_presenter.rb | 2 | ||||
-rw-r--r-- | app/presenters/status_relationships_presenter.rb | 7 |
2 files changed, 2 insertions, 7 deletions
diff --git a/app/presenters/filter_result_presenter.rb b/app/presenters/filter_result_presenter.rb index 677225f5e..1e9e8f3c1 100644 --- a/app/presenters/filter_result_presenter.rb +++ b/app/presenters/filter_result_presenter.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true class FilterResultPresenter < ActiveModelSerializers::Model - attributes :filter, :keyword_matches + attributes :filter, :keyword_matches, :status_matches end diff --git a/app/presenters/status_relationships_presenter.rb b/app/presenters/status_relationships_presenter.rb index d7ffb1954..be818a2de 100644 --- a/app/presenters/status_relationships_presenter.rb +++ b/app/presenters/status_relationships_presenter.rb @@ -33,12 +33,7 @@ class StatusRelationshipsPresenter active_filters = CustomFilter.cached_filters_for(current_account_id) @filters_map = statuses.each_with_object({}) do |status, h| - filter_matches = active_filters.filter_map do |filter, rules| - next if rules[:keywords].blank? - - match = rules[:keywords].match(status.proper.searchable_text) - FilterResultPresenter.new(filter: filter, keyword_matches: [match.to_s]) unless match.nil? - end + filter_matches = CustomFilter.apply_cached_filters(active_filters, status) unless filter_matches.empty? h[status.id] = filter_matches |