mirror of
https://github.com/Retrospring/retrospring.git
synced 2025-03-30 09:31:48 +02:00
9 lines
190 B
Ruby
9 lines
190 B
Ruby
class MuteRule < ApplicationRecord
|
|
belongs_to :user
|
|
|
|
validates_presence_of :muted_phrase
|
|
|
|
def applies_to?(post)
|
|
!!(post.content =~ /\b#{Regexp.escape(muted_phrase)}\b/i)
|
|
end
|
|
end
|