Retrospring/app/models/mute_rule.rb

8 lines
151 B
Ruby
Raw Normal View History

2021-12-22 10:21:09 -08:00
class MuteRule < ApplicationRecord
belongs_to :user
def applies_to?(post)
2021-12-22 10:33:19 -08:00
!!(post.content =~ /\b#{Regexp.escape(muted_phrase)}\b/i)
2021-12-22 10:21:09 -08:00
end
end