retrospring/app/models/mute_rule.rb
2022-01-01 00:38:38 +01:00

7 lines
151 B
Ruby

class MuteRule < ApplicationRecord
belongs_to :user
def applies_to?(post)
!!(post.content =~ /\b#{Regexp.escape(muted_phrase)}\b/i)
end
end