Add ng words for post/update
This commit is contained in:
parent
d4602118fb
commit
c553275381
12 changed files with 110 additions and 2 deletions
15
app/models/admin/ng_word.rb
Normal file
15
app/models/admin/ng_word.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class Admin::NgWord
|
||||
class << self
|
||||
def reject?(text)
|
||||
ng_words.any? { |word| text.include?(word) }
|
||||
end
|
||||
|
||||
private
|
||||
|
||||
def ng_words
|
||||
Setting.ng_words
|
||||
end
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue