retrospring/app/models/mute_rule.rb

8 lines
151 B
Ruby
Raw Normal View History

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