DEV: Refactor watched words (#24163)

- Ignore only invalid words, not all words if one of them is invalid

- The naming scheme for methods was inconsistent

- Optimize regular expressions
This commit is contained in:
Bianca Nenciu
2023-11-01 16:41:10 +02:00
committed by GitHub
parent a32fce9e1d
commit fd07c943ad
12 changed files with 170 additions and 155 deletions

View File

@@ -421,7 +421,7 @@ class AdminDashboardData
def watched_words_check
WatchedWord.actions.keys.each do |action|
begin
WordWatcher.word_matcher_regexp_list(action, raise_errors: true)
WordWatcher.compiled_regexps_for_action(action, raise_errors: true)
rescue RegexpError => e
translated_action = I18n.t("admin_js.admin.watched_words.actions.#{action}")
I18n.t(