From af8f06413ee3bab91f1fb89b5828ed9a44e1a6bd Mon Sep 17 00:00:00 2001 From: David Yip Date: Sun, 22 Oct 2017 01:11:17 -0500 Subject: KeywordMute matcher: more closely mimic Regexp#=~ behavior. Regexp#=~ returns nil if it does not match. An empty mute set does not match any status, so KeywordMute::Matcher#=~ ought to return nil also. --- app/models/glitch/keyword_mute.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/models/glitch') diff --git a/app/models/glitch/keyword_mute.rb b/app/models/glitch/keyword_mute.rb index 20fd89d9b..a7ab3650e 100644 --- a/app/models/glitch/keyword_mute.rb +++ b/app/models/glitch/keyword_mute.rb @@ -61,7 +61,7 @@ class Glitch::KeywordMute < ApplicationRecord end def =~(str) - regex ? regex =~ str : false + regex ? regex =~ str : nil end end end -- cgit