2017-06-28 16:56:44 -04:00
|
|
|
module Jobs
|
|
|
|
class MigrateCensoredWords < Jobs::Onceoff
|
|
|
|
def execute_onceoff(args)
|
2018-06-19 02:13:14 -04:00
|
|
|
row = DB.query_single("SELECT value FROM site_settings WHERE name = 'censored_words'")
|
2017-06-28 16:56:44 -04:00
|
|
|
if row.count > 0
|
2018-06-19 02:13:14 -04:00
|
|
|
row.first.split('|').each do |word|
|
2017-06-28 16:56:44 -04:00
|
|
|
WatchedWord.create(word: word, action: WatchedWord.actions[:censor])
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|