mirror of
https://github.com/discourse/discourse.git
synced 2024-12-05 09:56:30 +08:00
16 lines
411 B
Ruby
16 lines
411 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Jobs
|
|
class MigrateCensoredWords < ::Jobs::Onceoff
|
|
def execute_onceoff(args)
|
|
row = DB.query_single("SELECT value FROM site_settings WHERE name = 'censored_words'")
|
|
if row.count > 0
|
|
row
|
|
.first
|
|
.split("|")
|
|
.each { |word| WatchedWord.create(word: word, action: WatchedWord.actions[:censor]) }
|
|
end
|
|
end
|
|
end
|
|
end
|