2019-05-02 18:17:27 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2017-06-28 16:56:44 -04:00
|
|
|
module Jobs
|
2019-10-02 00:01:53 -04:00
|
|
|
class MigrateCensoredWords < ::Jobs::Onceoff
|
2017-06-28 16:56:44 -04:00
|
|
|
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
|