about summary refs log tree commit diff
path: root/app/models/glitch
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/glitch')
-rw-r--r--app/models/glitch/keyword_mute.rb8
1 files changed, 4 insertions, 4 deletions
diff --git a/app/models/glitch/keyword_mute.rb b/app/models/glitch/keyword_mute.rb
index 001be9201..a2481308f 100644
--- a/app/models/glitch/keyword_mute.rb
+++ b/app/models/glitch/keyword_mute.rb
@@ -62,8 +62,8 @@ class Glitch::KeywordMute < ApplicationRecord
       format('keyword_mutes:regex:text:%s', account_id)
     end
 
-    def =~(str)
-      regex =~ str
+    def matches?(str)
+      !!(regex =~ str)
     end
 
     private
@@ -82,8 +82,8 @@ class Glitch::KeywordMute < ApplicationRecord
       format('keyword_mutes:regex:tag:%s', account_id)
     end
 
-    def =~(tags)
-      tags.pluck(:name).detect { |n| regex =~ n }
+    def matches?(tags)
+      tags.pluck(:name).any? { |n| regex =~ n }
     end
 
     private