mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 19:37:55 +08:00
13 lines
380 B
Ruby
13 lines
380 B
Ruby
module Jobs
|
|
class MigrateCensoredWords < Jobs::Onceoff
|
|
def execute_onceoff(args)
|
|
row = WatchedWord.exec_sql("SELECT value FROM site_settings WHERE name = 'censored_words'")
|
|
if row.count > 0
|
|
row.first["value"].split('|').each do |word|
|
|
WatchedWord.create(word: word, action: WatchedWord.actions[:censor])
|
|
end
|
|
end
|
|
end
|
|
end
|
|
end
|