diff options
author | David Yip <yipdw@member.fsf.org> | 2017-10-22 01:11:17 -0500 |
---|---|---|
committer | David Yip <yipdw@member.fsf.org> | 2017-10-22 01:12:21 -0500 |
commit | af8f06413ee3bab91f1fb89b5828ed9a44e1a6bd (patch) | |
tree | 3a453447afed7afebd683ef47e2780f6f0deee8b /app/models/glitch/keyword_mute.rb | |
parent | 1a60445a5fa8208b54afaedf5e5796fb2ac0a80a (diff) |
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.
Diffstat (limited to 'app/models/glitch/keyword_mute.rb')
-rw-r--r-- | app/models/glitch/keyword_mute.rb | 2 |
1 files changed, 1 insertions, 1 deletions
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 |