Retrospring/app/models/mute_rule.rb

8 lines
136 B
Ruby

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