Fix lints

This commit is contained in:
Andreas Nedbal 2022-11-20 16:38:02 +01:00 committed by Andreas Nedbal
parent 9a4c0d576d
commit 41c43538b5
1 changed files with 3 additions and 1 deletions

View File

@ -1,7 +1,9 @@
# frozen_string_literal: true
class MuteRule < ApplicationRecord
belongs_to :user
validates_presence_of :muted_phrase
validates :muted_phrase, presence: true
def applies_to?(post)
!!(post.content =~ /\b#{Regexp.escape(muted_phrase)}\b/i)